Add-AzApplicationGatewayHttpListenerCustomError

將自定義錯誤新增至應用程式閘道的 HTTP 接聽程式。

Syntax

Add-AzApplicationGatewayHttpListenerCustomError
   -HttpListener <PSApplicationGatewayHttpListener>
   -StatusCode <String>
   -CustomErrorPageUrl <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

Description

Add-AzApplicationGatewayCustomError Cmdlet 會將自定義錯誤新增至應用程式網關的 HTTP 接聽程式。

範例

範例 1:將自定義錯誤新增至 HTTP 接聽程式層級

$customError502Url = "https://mycustomerrorpages.blob.core.windows.net/errorpages/502.htm"
$updatedlistener = Add-AzApplicationGatewayHttpListenerCustomError -HttpListener $listener01 -StatusCode HttpStatus502 -CustomErrorPageUrl $customError502Url

此命令會將 HTTP 狀態代碼 502 的自定義錯誤新增至 HTTP 接聽程式$listener 01,並傳回更新的接聽程式。

參數

-CustomErrorPageUrl

應用程式閘道客戶錯誤的錯誤頁面 URL。

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

用於與 Azure 通訊的認證、帳戶、租用戶和訂用帳戶。

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-HttpListener

應用程式閘道 Http 接聽程式

Type:PSApplicationGatewayHttpListener
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-StatusCode

應用程式閘道客戶錯誤的狀態代碼。

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

輸入

PSApplicationGatewayHttpListener

輸出

PSApplicationGatewayCustomError