Last active
March 20, 2023 09:37
-
-
Save papeMK2/1a4ecaec472a9498b8dbb87b0c8bce8f to your computer and use it in GitHub Desktop.
If backend return status code 500, redirect to any your url sample.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<policies> | |
<inbound> | |
<base /> | |
<set-backend-service id="apim-generated-policy" backend-id="{your backend id}" /> | |
</inbound> | |
<backend> | |
<base /> | |
</backend> | |
<outbound> | |
<base /> | |
<choose> | |
<when condition="@(context.Response.StatusCode == 500)"> | |
<set-status code="307" reason="error" /> | |
<set-header name="Location" exists-action="override"> | |
<value>@("{your redirect url}")</value> | |
</set-header> | |
</when> | |
</choose> | |
</outbound> | |
<on-error> | |
<base /> | |
</on-error> | |
</policies> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment