none
host value from request headers

    Question

  • hi i recently implemented cdn on my website and noticed that the host request header started returning the .azurewebsites.net domain instead of the custom domain. is this a known issue and is there a workaround? thanks.

    below is the code that returns the .azurewebsites.net domain

    HttpContext.Request.Headers["Host"]

    Friday, January 11, 2019 12:16 AM

Answers

All replies

  • Just to clarify, have you configured and added the appropriate DNS records for the custom domain on your app? Ensure that you have configured the Origin hostname appropriately.

    Friday, January 11, 2019 1:53 PM
    Moderator
  • Yes, I have configured and added the appropriate DNS records for the custom domain.
    Friday, January 11, 2019 10:24 PM
  • I was able to solve this issue by making the Origin Host Name and the Origin Host Header the same using my custom domain.  Thanks for your help.
    Saturday, January 12, 2019 1:01 AM
  • I spoke too soon.  The origin hostname had to be the azurewebsites.net domain, otherwise I get other issues like gateway timeout.  Since the Azure CDN origin is a web app, the origin host header has to be the same.  So I'm back to my original issue.
    Saturday, January 12, 2019 2:01 AM
  • I finally fixed this issue by setting the Origin host header on my CDN endpoint to my custom domain and left the Origin hostname pointing at azurewebsites.net.
    Monday, January 14, 2019 9:34 PM
  • I finally fixed this issue by setting the Origin host header on my CDN endpoint to my custom domain and left the Origin hostname pointing at azurewebsites.net.

    Apologies for the delay. Glad to know that you have fixed the issue. Thank you for sharing the solution that helped, it would benefit other users with a similar issue.


    Wednesday, January 16, 2019 7:08 AM
    Moderator