Access azure web app via ip address returns 404

If I access my web app via its IP address I get the default azure 404 not found web page.

I have configured a custom domain (A Record + Cname) which works fine if I use that.

Should I be able to access the web app via the IP address, and if so what else do I need to do.

This is causing a PCI compliance failure at the moment as the actual web site has server headers removed from the response, however the 404 page returns server headers as its not hitting my configured web site.

Thanks.

1 answer

  • answered 2018-10-12 07:09 Joey Cai

    If you want to access your site using the IP address, you need to explicitly pass the host header to tell Azure what site it is. This is because many sites share the same IP. The header should look like this:

    Host:MyExample.com
    

    Output: enter image description here