How to configure HTTP and HTTPS ports for origins and delivery address
With Azion Edge Application, you can customize your application’s delivery address ports as well as from which ports of your origin address your content is retrieved. This dual customization provides complete control over how your content is fetched from origin and delivered to your users for both HTTP and HTTPS protocols.
The choice of delivery ports are limited to those supported by Azion. However, for origins of the Single Origin or Load Balancer types, you can retrieve your content from the appropriate origin port, as long as the port exists.
Available port combinations
There are several port combinations you can configure for your application.
Use case | Example origin URL | Example delivery URL |
---|---|---|
Application served from default origin ports to default delivery ports | https://origin.com:443 | https://delivery.com:443 |
Application served from a default origin port to a different protocol of a default delivery port | http://origin.com:80 | https://delivery.com:443 |
Application served from a default origin port to a custom delivery port | http://origin.com:80 | http://delivery.com:8080 |
Application served from a custom origin port to a default delivery port | https://origin.com:9443 | https://delivery.com:443 |
Application served from a custom origin port to a custom delivery port | https://origin.com:8443 | https://delivery.com:9443 |
Configuring ports
To configure your application’s origin and delivery ports:
- Access Azion Console > Edge Application.
- Select the edge application you want to configure.
- Check the solutions for each use case below.
- Access Real-Time Manager (RTM) > Edge Application.
- Select the edge application you want to configure.
- Check the solutions for each use case below.
Default origin port to default application port
If you want your content to be drawn from a default port and served in a default application port, configure your edge application as follows:
- In the Origins tab, select the default origin or add a new origin.
- Fill in the required fields.
- Keep the option Preserve HTTP/HTTPS protocol selected.
- In Address, type the hostname of your origin. Example:
yourorigin.com
. - Click the Save button.
- In the Main Settings tab of your edge application, select one of the default HTTP or HTTPS ports. Example:
80
.
- If you determine your application is delivered via HTTP only, you’ll only be able to select port
80
. Enabling both HTTP and HTTPS will enable the HTTPS port443
.
- Click the Save button.
With this option enabled, access to your application through default ports will be through the default ports of your origin.
- In the Origins tab, select the default origin or add a new origin.
- Fill in the required fields.
- Keep the option Preserve HTTP/HTTPS protocol enabled.
- Under Address, type the hostname of your origin. Example:
yourorigin.com
. - Click the Save button.
- In the Main Settings tab of your edge application, select one of the default HTTP or HTTPS ports. Example:
80
.
- If you determine your application is delivered via HTTP only, you’ll only be able to select port
80
. Enabling both HTTP and HTTPS will enable the HTTPS port443
.
- Click the Save button.
With this option enabled, access to your application through default ports will be through the default ports of your origin.
Modified default origin port to default application port
You can modify the default port your application’s origin by enforcing protocols. For example, you can determine that your application will be delivered in HTTPS but the communication with origin servers should be made exclusively in HTTP. To do so, configure your application as follows:
- In the Origins tab, select the default origin or add a new origin.
- Fill in the required fields.
- In the section Protocol Policy, select Enforce HTTP if you want the edge to access your content explicitly through HTTP.
- Click the Save button.
- In the Main Settings tab of your edge application, select one of the default HTTP and HTTPS ports. Example:
80
and443
. - Click the Save button.
- In the Origins tab, select the default origin or add a new origin.
- Fill in the required fields.
- In the section Origin Protocol Policy, select Enforce HTTP if you want the edge to access your content explicitly through HTTP.
- Click the Save button.
- In the Main Settings tab of your edge application, select one of the default HTTP and HTTPS ports. Example:
80
and443
. - Click the Save button.
Custom origin port to default application port
You can use the host:port
notation to specify the port from which your content will be retrieved and deliver it through a default application port. In this case, your content will be retrieved from a custom port of your origin and delivered through the default port you selected. To do so:
- In the Origins tab, select the default origin or add a new origin.
- Fill in the required fields.
- Keep the option Preserve HTTP/HTTPS protocol enabled.
- In Address, type the hostname of your origin and add the port notation with the custom port. Example:
yourorigin.com:8080
. - Click the Save button.
- In the Main Settings tab of your edge application, select one of the default HTTP or HTTPS ports. Example:
443
. - Click the Save button.
- In the Origins tab, select the default origin or add a new origin.
- Fill in the required fields.
- Keep the option Preserve HTTP/HTTPS protocol enabled.
- Under Address, type the hostname of your origin and add the port notation with the custom port. Example:
yourorigin.com:8080
. - Click the Save button.
- In the Main Settings tab of your edge application, select one of the default HTTP or HTTPS ports. Example:
443
. - Click the Save button.
Default origin port to custom application port
To deliver your content from a default origin port to a custom application port:
- In the Origins tab, select the default origin or add a new origin.
- Fill in the required fields.
- Keep the option Preserve HTTP/HTTPS protocol enabled.
- In Address, type the hostname of your origin. Example:
yourorigin.com
. - Click the Save button.
- In the Main Settings tab of your edge application, select one of the custom HTTP or HTTPS ports. Example:
9443
. - Click the Save button.
- In the Origins tab, select the default origin or add a new origin.
- Fill in the required fields.
- Keep the option Preserve HTTP/HTTPS protocol enabled.
- Under Address, type the hostname of your origin. Example:
yourorigin.com
. - Click the Save button.
- In the Main Settings tab of your edge application, select one of the custom HTTP or HTTPS ports. Example:
9443
. - Click the Save button.
Custom origin port to custom application port
If you want requests to be directed to an origin only using custom ports, you must specify that requests to your application made from the custom port are directed to the correct port. To do so:
- On the Main Settings tab, under HTTP Ports, check which custom ports have been selected.
- Go to the Origins tab.
- Click the + Origin button.
- Give your origin an easy-to-remember name. Example:
Origin:8080
. - Fill in the required fields.
- Keep the option Preserve HTTP/HTTPS protocol enabled.
- In Address, use the
host:port
notation. Example:yourorigin.com:8080
. - Fill in the remaining fields with the desired values.
- Click the Save button.
- On the Main Settings tab, under Ports HTTP, check which custom ports have been selected.
- Go to the Origins tab.
- Click the Add Origin button.
- Give your origin an easy-to-remember name. Example:
Origin:8080
. - Fill in the required fields.
- Keep the option Preserve HTTP/HTTPS protocol enabled.
- Under Address, use the
host:port
notation. Example:yourorigin.com:8080
. - Fill in the remaining fields with the desired values.
- Click the Save button.
Now you need to configure your application so that when requests are received in custom ports, they’re redirected to the correct origin port:
- Go to the Rules Engine tab of the edge application.
- Click the + Rule button.
- Give your rule an easy-to-remember name. Example:
Set Origin :8080
. - Select Request Phase.
- Under the section Criteria, select the variable
${server_port}
. - For a comparison operator, select is equal to.
- As an argument, add the desired port. Example:
8080
. - In the Behaviors section, select the behavior Set Origin.
- Select the origin created in the previous instructions.
- Click the Save button.
- Go to the Rules Engine tab of the edge application.
- Click the New Rule button and select Request Phase.
- Give your rule an easy-to-remember name. Example:
Set Origin :8080
. - Under the section Criteria, select the variable
${server_port}
. - For a comparison operator, select is equal to.
- As an argument, add the desired port. Example:
8080
. - In the Behaviors section, select the behavior Set Origin.
- Select the origin created in the previous instructions.
- Click the Save button.
If more than one custom port was selected for the application, you may create additional rules, repeating the previous steps for each custom port selected.
From this moment on, when a request is made to the edge application using a custom port, the edge points the request to the assigned port when accessing the origin.