How to define a new origin for your application
This guide explains how to configure an origin. An origin, also known as a backend, is the server from which Azion retrieves your content. Origins can include object storage services, cloud servers, or other infrastructure that hosts your application assets or data.
There are separate instructions for API v3 using legacy Origin settings and API v4 using the new Connectors product.
- Access Azion Console > Connectors.
- Click the + Connector button.
- In the General section, give your connector a unique and descriptive name (
My Object Storage Connector). - In the Connector Type section, select HTTP.
- In the Connection Options section, locate the Transport Protocol Policy field and select Force HTTPS.
- In the Address Management section, locate the Address field and add
httpbin.org. - Under Host, add
customhost.com. - Click the Save button.
To activate the Connector in your application:
- Access the Rules Engine tab.
- Edit the default rule or add a new request rule.
- Give your rule a name.
- Select Request Phase.
- Under the Criteria section, select the variable
${uri}. - As a comparison operator, select is equal.
- As an argument, add
/httpbin. - In the Behaviors section, select Set Connector from the behavior list.
- Select the new Connector you created.
- Click the Save button.
- Wait a few minutes for the changes to propagate, then access
xxxxxxxxxx.map.azionedge.net/httpbin.
When you create an application, a default origin is created and activated automatically. This guide shows you how to create and activate a new origin with different configurations without removing or editing the default origin.
- Access Azion Console > Applications.
- Click the application for which you want to configure a new origin.
- Select the Origins tab.
- Click the + Origin button.
- Give your new origin a name. For example:
httpbin.org. - Under Type, keep Single Origin selected.
- Under Protocol Policy, select Enforce HTTPS.
- Under Address, add
httpbin.org. - Under Host Header, add
customhost.com.
- Leave Origin Path blank.
- Click Save.
The origin is created, but it isn’t active yet. You need to create a Rules Engine rule to route requests to it.
- Navigate to the Rules Engine tab.
- Click the + Rule button.
- Give your rule a name.
- Select Request Phase.
- Under the Criteria section, select the variable
${uri}.
- As a comparison operator, select is equal.
- As an argument, add
/httpbin. - In the Behaviors section, select Set Origin from the behavior list.
- Select the new origin you created.
- Click Save.
- Wait a few minutes for the changes to propagate, then access
xxxxxxxxxx.map.azionedge.net/httpbin.
- Run the following
POSTrequest in your terminal. Replace[TOKEN VALUE]with your personal token and<application_id>with your application ID:
curl --location 'https://api.azionapi.net/edge_applications/<application_id>/origins' --header 'Accept: application/json; version=3' --header 'Content-Type: application/json' --header 'Authorization: Token [TOKEN VALUE]' --data '{ "name": "httpbin.org SO HTTPS Host:customhost.com", "origin_type": "single_origin", "addresses": [ { "address": "httpbin.org" } ], "origin_protocol_policy": "https", "host_header": "customhost.com"}'| Key | Description |
|---|---|
name | Name of the origin. |
origin_type | Origin type. Set to single_origin for a single address. For load balancing across multiple addresses, see Work with multiple origins. |
addresses | List of origin address objects. For single_origin, you can only send one object in the array. |
origin_protocol_policy | Connection protocol between edge nodes and the origin. When set to https, enforces HTTPS regardless of the protocol used by the end user. |
host_header | Value sent in the Host header to the origin. Use a specific FQDN (e.g., customhost.com) for a single virtualhost. Use ${host} to forward the end user’s Host header, useful when your origin serves multiple virtualhosts. |
- You’ll receive a response similar to this:
{ "results": { "origin_id": <origin_id>, "origin_key": <origin_key>, "name": "httpbin.org SO HTTPS Host:customhost.com", "origin_type": "single_origin", "addresses": [ { "address": "httpbin.org", "weight": null, "server_role": "primary", "is_active": true } ], "origin_protocol_policy": "https", "is_origin_redirection_enabled": false, "host_header": "customhost.com", "method": "", "origin_path": "", "connection_timeout": 60, "timeout_between_bytes": 120, "hmac_authentication": false, "hmac_region_name": "", "hmac_access_key": "", "hmac_secret_key": "" }}- Run the following
POSTrequest in your terminal. Replace[TOKEN VALUE]with your personal token,<application_id>with your application ID, and<origin_id>with the origin ID returned in the previous step:
curl --location 'https://api.azionapi.net/edge_applications/<application_id>/rules_engine/request/rules' --header 'Accept: application/json; version=3' --header 'Content-Type: application/json' --header 'Authorization: Token [TOKEN VALUE]' --data '{ "name": "Set httpbin /httpbin", "behaviors": [ { "name": "set_origin", "target": "<origin_id>" } ], "criteria": [ [ { "variable": "${uri}", "operator": "is_equal", "conditional": "if", "input_value": "/httpbin" } ] ]}'- A successful response confirms the rule was created.
- Wait a few minutes for the changes to propagate, then access
xxxxxxxxxx.map.azionedge.net/httpbin. Try accessing any other unconfigured URI — you should receive a404error.
- Run the following
POSTrequest in your terminal. Replace[TOKEN VALUE]with your personal token and<application_id>with your application ID:
curl --request POST --url https://api.azion.com/v4/edge_connector/connectors --header 'Accept: application/json' --header 'Authorization: Token [TOKEN VALUE]' --header 'Content-Type: application/json' --data '{ "name": "httpbin.org SO HTTPS Host:customhost.com", "active": true, "type": "http", "attributes": { "addresses": [ { "active": true, "address": "httpbin.org", "http_port": 80, "https_port": 443 } ], "connection_options": { "dns_resolution": "preserve", "transport_policy": "force_https", "http_version_policy": "http1_1", "host": "customhost.com", "path_prefix": "", "following_redirect": false, "real_ip_header": "X-Real-IP", "real_port_header": "X-Real-PORT" }, "modules": { "load_balancer": { "enabled": false, "config": { "method": "round_robin", "max_retries": 0, "connection_timeout": 60, "read_write_timeout": 120 } }, "origin_shield": { "enabled": false, "config": null } } }}'| Key | Description |
|---|---|
name | Name of the Connector. |
type | Connector type. Set to http for HTTP/HTTPS origins. For load balancing across multiple addresses, see Work with multiple origins. |
addresses | List of origin address objects. For a single origin, you can only send one object in the array. |
transport_policy | Connection protocol between edge nodes and the origin. When set to force_https, enforces HTTPS regardless of the protocol used by the end user. |
host | Value sent in the Host header to the origin. Use a specific FQDN (e.g., customhost.com) for a single virtualhost. Use ${host} to forward the end user’s Host header, useful when your origin serves multiple virtualhosts. |
- You’ll receive a response similar to this:
{
{"state": "pending","data": { "id": <connector_id>, "name": "httpbin.org SO HTTPS Host:customhost.com", "last_editor": "your-email@example.com", "last_modified": "2025-08-14T18:12:20.161667Z", "active": true, "product_version": "1.0", "type": "http", "attributes": { "addresses": [ { "active": true, "address": "httpbin.org", "http_port": 80, "https_port": 443, "modules": null } ], "connection_options": { "dns_resolution": "preserve", "transport_policy": "force_https", "http_version_policy": "http1_1", "host": "customhost.com", "path_prefix": "", "following_redirect": false, "real_ip_header": "X-Real-IP", "real_port_header": "X-Real-PORT" }, "modules": { "load_balancer": { "enabled": false, "config": null }, "origin_shield": { "enabled": false, "config": null } } }}}- Run the following
POSTrequest in your terminal to bind the new Connector to your application. Replace[TOKEN VALUE]with your personal token,<application_id>with your application ID, and<connector_id>with the Connector ID returned in the previous step:
curl --request POST --url https://api.azion.com/v4/edge_application/applications/<application_id>/request_rules --header 'Accept: application/json' --header 'Authorization: Token [TOKEN VALUE]' --header 'Content-Type: application/json' --data '{"name": "string","active": true,"criteria": [ { "conditional": "if", "variable": "${uri}", "operator": "is_equal", "argument": "/httpbin" } ]],"behaviors": [ { "type": "set_edge_connector", "attributes": { "value": "<connector_id>" } }]}'- A successful response confirms the rule was created.
- Wait a few minutes for the changes to propagate, then access
xxxxxxxxxx.map.azionedge.net/httpbin. Try accessing any other unconfigured URI — you should receive a404error.