Azure Application Gateway 502错误

Sha*_*bir 4 gateway azure

我正在使用Azure应用程序网关,并坚持以下错误.在这里,我的网络图 App Gateway与云服务

这里,我配置了PowerShell脚本Poweshell输出PS C:\ Users\shabbir.akolawala> Get-AzureApplicationGateway sbr2appgateway

Name          : sbr2appgateway
Description   :
VnetName      : Group Shabs-AppGateway2 sbag2vnet
Subnets       : {sbag2subnet1}
InstanceCount : 2
GatewaySize   : Small
State         : Running
VirtualIPs    : {104.41.159.238} <-- Note IP Here
DnsName       : 01b9b0e4-4cd2-4437-b641-0b5dc4e3efe7.cloudapp.net
Run Code Online (Sandbox Code Playgroud)

这里,应用程序网关的公共IP是104.41.159.238现在,如果我第一次点击网关,你得到以下输出注意,这个网站无法正确呈现,因为许多请求(css/images)失败了502 .

网关的第一反应

现在,如果我第二次点击,我会立即得到502错误

在此输入图像描述

但是,当点击云服务IP时,我正确地获得了我的网站

网站使用云服务呈现正确

我使用以下配置XML配置Azure网关

我的问题是,

1]是否知道如何访问Application Gateway中生成的日志(理论上,应用程序网关在IIS 8.5/ARR上运行)

2]我在设计或配置方面有任何明显错误吗?

Lan*_*ang 5

这是因为超时.1,Probe默认30秒超时.如果您的应用程序需要身份验证,则必须设置自定义探测.

2,Application Gateway也有默认的30秒超时.如果您的Application Gateway无法从后端虚拟机获得响应.它将返回HTTP 502.它可以通过" RequestTimeout "配置项进行更改.

电源外壳:

  set-AzureApplicationGatewayConfig -Name <application gateway name> -    Configfile "<path to file>"
Run Code Online (Sandbox Code Playgroud)

配置文件:

 <BackendHttpSettings>
    <Name>setting1</Name>
    <Port>80</Port>
    <Protocol>Http</Protocol>
    <CookieBasedAffinity>Enabled</CookieBasedAffinity>
    <RequestTimeout>120</RequestTimeout>
  <Probe>Probe01</Probe> 
Run Code Online (Sandbox Code Playgroud)

详情请访问:https://azure.microsoft.com/en-us/documentation/articles/application-gateway-create-probe-classic-ps/