gpt4 book ai didi

azure - 应用程序网关 - 502 错误

转载 作者:行者123 更新时间:2023-12-01 13:30:42 25 4
gpt4 key购买 nike

我已经按照 MS 文档设置了一个新的应用程序网关。我已经配置了后端池。它通过 FQDN 连接到应用程序服务。不知何故,每次浏览应用程序网关时,我都会立即收到 502。直接浏览网站没有任何问题。

最佳答案

我已经解决了这个问题。这是解决方案。

如果您的后端池中有 Web 应用程序,则无法通过 Azure 门户设置运行状况探测。

您需要通过资源模板或 Powershell 设置它们。关键是您需要将主机字段留空并设置 -PickHostNameFromBackendAddress 属性。

The two lines below did the magic to make the 502s go away

# 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

关于azure - 应用程序网关 - 502 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46046056/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com