Search code examples
azureazure-web-app-serviceazure-virtual-networkazure-application-gateway

Azure Web Application Gate (w/WAF) public IP opening/redirecting Azure App Services on port 80 instead of actual Web App


I have a App Gateway WAF V2 configured for both public and private IP for my Azure Web Application (this uses Azure AD Authentication to access also), when I try to access the Web App through the App Gateway Public IP Address it will open on the page "webapp.azurewebsites.net:80" which leads to the following error:

enter image description here

The expected behaviors is that the "webapp.azurewebsites.net" (without the port 80 at the end) will be loaded and the web app displayed, if I remove the :80 from the end of the URL it loads as expected.

These are my configurations below for the Application Gateway (My Backend Setting and Backend Pool both have the same name btw) Listeners:

Public

User's image

Private

enter image description here

Rules: Public enter image description here

enter image description here

Private enter image description here

enter image description here

Backend Pool: enter image description here

Backend Settings

enter image description here

enter image description here


Solution

  • I have followed the same step and got the same error :

    This site can’t provide a secure connection webappXXX.azurewebsites.net sent an invalid response. Try running Windows Network Diagnostics. ERR_SSL_PROTOCOL_ERROR

    To resolve this issue, check the below workaround:

    In your App service -> configuration -> General setting.

    enter image description here

    By default, your app service would have HTTPS only change to off like below:

    enter image description here

    When HTTPS only is enabled, all HTTP traffic is redirected to HTTPS if you turn off the HTTPS only it will redirect successfully.

    Note: Once you turn off, Restart the app service and make sure to clear cache on 24hr.

    Now when I hit the application gateway public Ip it redirects successfully like below:

    enter image description here

    enter image description here

    Alternatively, if you don't want to change App service you can use port 443 in Http setting and use well known certificate as yes check the MsDoc