应用程序网关-502错误 [英] Application Gateway - 502 error
问题描述
我已按照MS文档设置了新的应用程序网关.我已经配置了后端池.它通过FQDN连接到App Service.每次我浏览到应用程序网关时,都会以某种方式立即收到502.浏览到该网站可以直接进行,没有任何问题.
I have set up a new application Gateway following the MS document. I have configured the back end pool .it is connected to an App Service via FQDN. Somehow I receive 502 immediately every time I browse to the application gateway. Browsing to the website directly works with no issues .
推荐答案
我已经解决了此问题.这是解决方案.
I have resolved this issue. Here is the solution.
如果后端池中有Web应用程序,则无法通过Azure门户设置运行状况探针.
If you have web apps in your backend pools you CAN'T set up the health probes via Azure portal.
您需要通过资源模板或Powershell进行设置.关键是您需要将主机字段保留为空并设置-PickHostNameFromBackendAddress
属性.
You need to set them up via resource templates or Powershell. The key is that you need to leave the host field empty and set -PickHostNameFromBackendAddress
property.
# Create a probe with the PickHostNameFromBackendHttpSettings switch for web apps
$probeconfig = New-AzureRmApplicationGatewayProbeConfig -name webappprobe -Protocol Http -Path / -Interval 30 -Timeout 120 -UnhealthyThreshold 3 -PickHostNameFromBackendHttpSettings
# Define the backend http settings
$poolSetting = New-AzureRmApplicationGatewayBackendHttpSettings -Name appGatewayBackendHttpSettings -Port 80 -Protocol Http -CookieBasedAffinity Disabled -RequestTimeout 120 -PickHostNameFromBackendAddress -Probe $probeconfig
这篇关于应用程序网关-502错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!