Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
By default, when Azure Web Application Firewall (WAF) on Azure Application Gateway blocks a request due to a matched rule, it returns a 403 status code with the message "The request is blocked." You can customize the response by configuring a custom status code and message to better suit your use case.
This article shows you how to configure a custom response page when Azure Application Gateway's Web Application Firewall (WAF) blocks a request using the Azure portal. You can also configure custom responses using the Azure CLI or PowerShell.
Configure a custom response status code and message
To customize the response status code and body, take the following steps:
Go to your Application Gateway WAF policy in the Azure portal.
Under Settings, select Policy settings.
Enter the custom response status code and response body in Block response status code and Block response body respectively.
Select Save.
In this example, we changed the default 403 response code to 429 and set a brief message stating, The request has been blocked.