Hi,
Current my website www.example.com is hosted on a dedicated server with cPanel. Users can visit my website via www.example.com or example.com.
Now I need to use my website as the origin and use Amazon Cloudfront distribution for it as a CDN. Amazon Cloudfront does not allow to use an IP address as the origin, neither can I use www.example.com or example.com as the origin domain, since they will point to the distribution after I setup the Cloudfront distribution.
So I add a new A record in the DNS zone editor, i.e.
web.example.com. -> 12.34.56.78(IP of the dedicated server)
And then take web.example.com as the origin domain.
Now the problem is that Cloudfront will include the following header to the request:
Host: web.example.com
And I cannot modify the header.
And then such a Host header is passed to my server, it seems that the server cannot accept the Host web.example.com as a valid host name for example.com and will always return 404 error below:
"The server cannot find the requested page"
"web.example.com/wp-admin/ (port 443)"
So now what I need to do is to let web.example.com to be another valid host name for example.com, just like www.example.com. How to do so?
Thanks
Current my website www.example.com is hosted on a dedicated server with cPanel. Users can visit my website via www.example.com or example.com.
Now I need to use my website as the origin and use Amazon Cloudfront distribution for it as a CDN. Amazon Cloudfront does not allow to use an IP address as the origin, neither can I use www.example.com or example.com as the origin domain, since they will point to the distribution after I setup the Cloudfront distribution.
So I add a new A record in the DNS zone editor, i.e.
web.example.com. -> 12.34.56.78(IP of the dedicated server)
And then take web.example.com as the origin domain.
Now the problem is that Cloudfront will include the following header to the request:
Host: web.example.com
And I cannot modify the header.
And then such a Host header is passed to my server, it seems that the server cannot accept the Host web.example.com as a valid host name for example.com and will always return 404 error below:
"The server cannot find the requested page"
"web.example.com/wp-admin/ (port 443)"
So now what I need to do is to let web.example.com to be another valid host name for example.com, just like www.example.com. How to do so?
Thanks
Last edited by a moderator: