我在应用程序网关后面有 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
错误。
需要什么额外的配置才能使它工作?