# Origins

import DocButton from '~/components/webkit/DocButton.vue';


import Apiv4Rollout from '~/includes/snippets/apiv4Rollout/en/snippet.mdx'

<Apiv4Rollout />

:::caution[important]
The Origins feature has been replaced by **Connectors**.
For more information about the new product, visit the [Connectors reference](/en/documentation/products/secure/connectors/).
:::

**Origins** allows you to customize the source address of your **Applications** content, the `Host` header of your application, the path, and the HMAC authentication credentials for protected services.

An origin represents the server from which Azion retrieves your content, which can be an object storage service or a cloud server. Once an origin is connected to your application, edge nodes cache the content from the origin server and serve it to users upon a request.

## Implementation

| Scope | Resource |
| --- | --- |
| Applications first steps | [First steps](/en/documentation/products/build/applications/first-steps/#origins) |
| Load Balancer module | [Load Balancer](/en/documentation/products/secure/connectors/load-balancer/) |

---

## Origin Type

There are three options for you to customize your origin:

- **Single Origin**: create one **Address** for each origin.
- **Load Balancer**: add multiple **Addressess** and determine load weight and server role.
- **Object Storage**: select a bucket and prefix from the Azion **Object Storage** to serve the application.

### Load Balancer

When **Load Balancer** is selected as an origin type, you can configure the **Balancing Method** to determine how large amounts of requests are distributed among addresses, add multiple **Addresses** to your origin, and change the **Sever Role** and **Weight** of each address.

<DocButton href="/en/documentation/products/secure/connectors/load-balancer/" label="Learn more about Load Balancer" size="medium" />

### Object Storage

When **Object Storage** is selected as an origin type, you must add the **Bucket Name** and **Prefix**.

The bucket name is defined when you [create or modify an Object Storage bucket](/en/documentation/products/guides/create-and-modify-bucket/).

The prefix is the path to the folder within the bucket that stores the objects. This field can be left blank if you wish your application's origin to be the root of the bucket.

<DocButton href="/en/documentation/products/store/object-storage/" label="go to Object Storage reference" size="medium" />

---

## Host Header

The `Host` header is used by your origin to identify the *virtualhost* and locate your content or application. When configuring an origin in [Azion Console](https://console.azion.com), you have the option to customize the value sent by Azion in the `Host` header.

If the **Host Header** field is left blank, Azion will use the same address specified in the **Address** field as the default. If your origin is configured to respond to a *virtualhost* using the same address as configured in DNS, you can leave the **Host Header** field empty.

However, if your origin responds to a *virtualhost* at an address different from the one set in DNS, you must fill in a custom value for the `Host` header in FQDN format, for example, `www.yourdomain.com`.

:::caution
Customizing the `Host` header is essential if your origin responds to a *virtualhost* at an address other than the one configured in DNS.
:::

Alternatively, you can use the `${host}` variable in the **Host Header** field to instruct the edge nodes to pass on the `Host` header received from your visitors to the origin. This setting is useful if you have multiple *virtualhosts* being served by the same origin.

---

## Origin Path

**Origin Path** allows you to specify a custom path from which edge nodes will request your origin content. Azion appends the **Origin Path** to the URI when forwarding the request to your origin, but it doesn't append the URI for user requests. For instance, if you determine that the path of your origin is under `/secure` and you have configured your application to be delivered through `yourdomain.com`, the `/secure` path won't be part of the request to the end user.

:::caution
The definition of an **Origin Path** is optional. If not specified, only the root URI will be considered.
:::

---

## Address

To define an origin for your content, you need to specify the address of your server as either a domain name in FQDN format or an IPv4/IPv6 address. If you have defined the **Origin Protocol Policy** as **Enforce HTTP** or **Enforce HTTPS**, you can customize the origin port using the notation `host:port`.

---

## Origin Protocol Policy

Azion's delivery architecture offers you the flexibility to tailor the type of connection between the edge nodes and your origin based on your specific requirements:

- **Preserve HTTP/HTTPS protocol**: this option maintains the same connection protocol (*HTTP or HTTPS*) and ports used by your users when accessing your content on Azion. It ensures seamless continuity from Azion to your origin server.
- **Enforce HTTP**: with this setting, the connection between Azion's edge nodes and your origin will be exclusively through HTTP, regardless of the connection protocol and ports used by your users to access Azion's content. You can customize a specific port for your origin in the **Address** field, deviating from the default port (80 for HTTP) if desired.
- **Enforce HTTPS**: this option mandates the connection between Azion's edge nodes and your origin to be exclusively through HTTPS, regardless of the connection protocol and ports used by your users to access Azion's content. You can customize a specific port for your origin in the **Address** field, different from the default port (443 for HTTPS) if required.

---

## HMAC Authentication 

For **Single Origin**, if the origin is located in an object storage with private access, you must provide HMAC authentication credentials. When enabling HMAC authentication, your private content will begin to be delivered to your users through **Applications**. 

You should include in the HMAC access credentials given by your storage provider: **Region**, **Access Key**, and **Secret Key**. 

:::note
**Secret Key** is protected by being displayed only to its users with write permission and maintaining their access security.
:::

---

## Timeouts 

Displays timeout setting in seconds pre-defined by Azion. To customize timeout values, [contact the support team](https://tickets.azion.com/en/support/login).