应用程序网关-502错误 [英] Application Gateway - 502 error

查看:189
本文介绍了应用程序网关-502错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已按照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.

以下两行使502消失的魔力

# 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆