I have 2 web apps behind Application Gateway. I am trying to access by http://<aap_gateway_pub_ip>/web1
should go to http://webapp1.azurewebsites.net
and http://<aap_gateway_pub_ip>/web2
should go to http://webapp2.azurewebsites.net
. I have defined path based rule like:
$web1PathRule = New-AzureRmApplicationGatewayPathRuleConfig -Name web1pathrule -Paths "/web1" -BackendAddressPool $regbackendpool -BackendHttpSettings $poolSetting
$web2PathRule = New-AzureRmApplicationGatewayPathRuleConfig -Name web2pathrule -Paths "/web2" -BackendAddressPool $accbackendpool -BackendHttpSettings $poolSetting
$urlpathmap = New-AzureRmApplicationGatewayUrlPathMapConfig -Name urlpathmap -PathRules $web1PathRule, $web2PathRule -DefaultBackendAddressPool $defaultPool -DefaultBackendHttpSettings $poolSetting
$urlRoutingRule = New-AzureRmApplicationGatewayRequestRoutingRule -Name routingrule-001 -RuleType PathBasedRouting -HttpListener $defaultlistener -UrlPathMap $urlpathmap
The issue is when I directly access http://<aap_gateway_pub_ip>
request goes to default pool which is web1
backendpool and opens web1
app. But when I access http://<aap_gateway_pub_ip>/web1
, it returns 404
error.
What additional configuration is required to make this working?