1
votes

I have setup my Application Gateway and added a CNMAME in my domain to point to the DNS Name of the application gateway. The application gateway will point to 3 sites eventually . I created 3 web apps and have added each to the backend pool . I initially used the default HTTP Settings (appGatewayBackendHttpSettings ) but realised I needed to point to 3 health probes so I duplicated this HTTP Setting and allocated it to one of the listerners and pointed this to a health probe for one of the site.

I then configured my applicationgateway as below but get a 404 error when navigating to the site even though the probe shows its healthy.

mydomainListener
Frontend IP Configuration : appGatewayFrontendIP 
FrontendPort : appGatewayFrontendPort (443)
hostname : test.mydomain.com
Protocol : HTTPS
Certificate : test-cert
Associated Rule : testRule

TestRule
Type: Basic
Backendpool:testBackendPool
HTTP setting : testHTTPSetting

testHTTPSetting
Cookie based affinity : Disabled
Connection draining : Disabled
Protocol : HTTPS
Port : 443
Backend authentication certificates :mycert
Use a Custom Prove : testHTTPSProbe
Request Timeout : 30

testHTTPSProbe: 
Host : test-azurewebsites.net
Protcol  : HTTPS
Path : /
Interval : 30 
Timeout 30
Unhealthy Threshold : 3
Minimum healthy servers :0
1
what does the backend health report? does it report healthy? - 4c74356b41
when i click on Backend health it shows probe as healthy and Success which is why I dont know why Im getting error 404 - itye1970

1 Answers

5
votes

Ok, i suspect this is due to the fact that you need to configure your webapps to use custom domain names. When request comes to them the request is looking for mydomain.com, but your websites only listen on test.azurewebsites.net.

Navigate to webapp > custom domain > plus icon > validate > add. You can read linked article for more details and also follow on screen prompts

Reference: https://docs.microsoft.com/en-us/azure/app-service/app-service-web-tutorial-custom-domain

ps. alternatively you can use backend hostname property to send hostname to backend servers

reference:
https://docs.microsoft.com/en-us/cli/azure/network/application-gateway/http-settings?view=azure-cli-latest#az-network-application-gateway-http-settings-create
https://docs.microsoft.com/en-us/rest/api/application-gateway/applicationgateways/createorupdate#applicationgatewaybackendhttpsettings