Origin Host
Origin Host specifies the value of the HOST field in the HTTP request header when a CDN PoP pulls content from the origin server. It determines which website's resources the origin server identifies and responds to. This configuration is critical for accurate content pulls, especially when object storage or virtualized hosting is used.
Why Origin Host?
In CDN acceleration scenarios, users access resources via acceleration domains (for example, www.example.com). If the requested content is not cached, CDN PoPs need to pull the content from the origin server. By default, CDN PoPs use acceleration domain names as the values of the HOST fields for origin pull requests.
However, if the origin server is a virtual host or an object storage bucket, a single IP address often serves multiple domains. The origin server relies on the HOST field to distinguish between different website resources. If the acceleration domain name does not match the domain name configured on the origin server, the origin server cannot identify the request, resulting in a 404 error or displaying an error page. Configuring a custom HOST field enables CDN PoPs to retrieve content from the origin server. This ensures that the origin server accurately identifies and delivers the correct content.
Advantages
- Flexible configuration: Customizing the HOST field value removes the restriction of using only acceleration domain names. This allows seamless adaptation to complex origin server architectures.
- Broad compatibility: Origin HOST is compatible with virtual hosts, object storage services, and load balancing architectures. It resolves resource targeting issues across multiple websites sharing a single IP address.
- Architecture transparency: HOST customization occurs strictly between CDN and the origin server. This ensures user access behavior and logic remain completely unaffected.
Differences Between Origin Host and Origin Server
- The origin server decides the address to be accessed during origin pull.
- The origin host decides the site that is associated with the requested content.
Assume that your origin server is an Nginx server, its IP address is x.x.x.x, and its domain name is www.test.com. The following sites are deployed on the origin server:
server { listen 80; server_name www.a.com; location / { root html; } } server { listen 80; server_name www.b.com; location / { root html; } }If you want CDN to pull content from this Nginx server, set the origin server address to x.x.x.x or www.test.com on CDN. Since there are multiple sites on the origin server, you need to specify the specific site to pull content. If you want CDN to obtain content from the www.a.com site, set the host to www.a.com on CDN. If you want CDN to obtain content from the www.b.com site, set the host to www.b.com on CDN.
Related Operations and Features
- Connect a domain name to CDN for acceleration: Getting Started with CDN.
- Modify the origin server settings of an acceleration domain name: Modifying Origin Server Settings.
- Modify the origin host of an acceleration domain name: Modifying the Host Header.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.