Host Header and Port

Last update:2026-05-08 17:55:58

CDN Back-to-Origin by default uses the acceleration domain and the port requested by the user (client) for back-to-origin. If you need to customize the specific server domain name and back-to-origin port for a CDN back-to-origin request, you can achieve this by configuring the Host Header and Port.

Difference Between Origin Server and Origin Host Header

  • Origin Server: The origin server is the server where your business content is stored, and it determines the specific IP address requested during the back-to-origin process.
  • Origin Host Header: When your origin server has multiple services shared, you can distinguish different services through the Host Header carried in the back-to-origin request. The CDN back-to-origin request header will carry the value of the Host field, which determines the specific site accessed at that IP address. This site carries one of the multiple services from the origin server.

How to Set Host Header and Port

There are several ways to configure this, but make sure you do not set it repeatedly to avoid configuration conflicts.

Path 1

  1. Log in to the CDNetworks Console and select the appropriate product.
  2. Navigate to the Configuration, locate the domain you wish to configure, and click Cloud Security Product Maintenance Announcement
  3. Find Origin Settings > Host Header and Port, click Port or Host Header to set.

Path 2

  1. Log in to the CDNetworks Console and select the appropriate product.
  2. Navigate to the Configuration, locate the domain you wish to configure, and click Cloud Security Product Maintenance Announcement or Batch Edit Origin, click Port or Host Header to set.

Path 3

  1. Log in to the CDNetworks Console and select the appropriate product.
  2. Navigate to the Configuration, locate the domain you wish to configure, click on Edit Configuration on the top or the Edit button to the right of the domain Cloud Security Product Maintenance Announcement
  3. Find Origin Settings > Origin URL Rewrite, click Add or Modify, and then find Host Header to set.

Parameter Description

Parameter Description Example
Port If the port is not configured, the original request’s port is followed for back-to-origin. This port configuration applies to the basic origin setting. If you need to configure the port in the advanced origin setting, please contact CDNetworks technical support. 8141
Host Header When your origin server has multiple services shared, you can distinguish different services through the back-to-origin request Host carried in the back-to-origin request. www.test.com

After you have completed setting the configurations, please click OK and then select Next to submit your settings. To minimize any potential disruptions to your production environment, we strongly recommend conducting a Pre-deploy test in a staging environment. This crucial step ensures that your configurations are accurate before they go live. Once you have verified the accuracy of the settings, click Deploy Now to implement them in the live environment. The configurations typically become effective within 3-5 minutes. For comprehensive guidance on pre-deployment testing and to verify the effectiveness of your configurations, please consult the tutorial Deploy the Configurations to Staging Environment for Validation.

Best Practices

Assuming the back-to-origin domain is www.0011.com, the origin request host header is www.test.com, and the origin request port is 8141.
Suppose the user accesses the resource using the request URL http://acceleration-domain/test.jpg. If the CDN has not cached the resource, then when the CDN goes back to origin, it resolves the origin domain www.0011.com to get the origin server address (assuming the resolved back-to-origin IP is 1.1.1.1), then the CDN accesses the 1.1.1.1 server for back-to-origin, carrying the request Host header www.test.com and the port 8141. Consequently, the origin server will find and return the test.jpg file under www.test.com to the CDN, and ultimately to the user.

Notes

This port configuration applies to the basic origin setting. If you need to configure the port in the advanced origin setting, please contact CDNetworks technical support.

Is the content of this document helpful to you?
Yes
I have suggestion
Submitted successfully! Thank you very much for your feedback, we will continue to strive to do better!