0
votes

I am trying to protect a web app using a virtual network. So I created network resources as this link describes. Then I created an application gateway as per the instruction of this link.

Finally I did what this link says to configure the web app.

However, when I went to my web app, under the networking I didn't see it being connected to any VNet. It was saying the VNet doesn't have any Virtual Network Gateway. So I created a VNG and then I went back to the web app, networking and connected it to the VNet.

Now under the Application Gateway health prob I expect the health probs to be successful. But I keep getting a 404. I checked my web app log and no request seems to be coming in.

In a nutshell I have the following:

  • Virtual Network (VNet): 10.0.0.0/16
  • Virtual Network Gateway (VNG): 10.1.0.0/24
  • Application Gateway (AG): this has a public IP. I created a CName on mydomain.com to point to this AG
  • VNet has 3 subnets: Backend SN(10.0.1.0/24), App Gateway SN(10.0.2.0/24) and another called Gateway SN(10.0.0.0/24)
  • The AG, has a backend pool, HTTP Settings and a Frontend IP
  • The AG backend pool points to the web app service
  • The AG HTTP Settings points to port 80, and the Pick hostname from backend address is checked
  • The AG also has Listener where the hostname is set to mydomain.com

I believe at this stage if I go to mydomain.com then I should see my web app. But I get the error:

502 - Web server received an invalid response while acting as a gateway or proxy server. There is a problem with the page you are looking for, and it cannot be displayed. When the Web server (while acting as a gateway or proxy) contacted the upstream content server, it received an invalid response from the content server

And the probs still get 404.

Can someone help please?

1

1 Answers

0
votes

What fixed it for me was that I need to make sure -PickHostNameFromBackendAddress is set when doing New-AzureRmApplicationGatewayBackendHttpSettings.