我在Application Gateway后面有2个Web应用程序。我想通过http://<aap_gateway_pub_ip>/web1
访问http://webapp1.azurewebsites.net
,http://<aap_gateway_pub_ip>/web2
应该转到http://webapp2.azurewebsites.net
。我已经定义了基于路径的规则,如:
$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
问题是当我直接访问http://<aap_gateway_pub_ip>
请求进入默认池web1
后端池并打开web1
应用时。但是当我访问http://<aap_gateway_pub_ip>/web1
时,它会返回404
错误。
需要哪些其他配置才能使其正常工作?