How to replace the default Azure 403 error page

I have ASP.NET MVC deployed for Azure and login, although using a client certificate. Locally, if the user does not send the certificate or is invalid, the website redirects the user to the / error / 403 endpoint. But this does not work on Azure: the user does not redirect to / error / 403, and the page displayed is always like this: enter image description here

This is my Web.Config code inside <system.webServer>node:

<httpErrors errorMode="Custom" existingResponse="Replace">
  <clear />
  <error statusCode="400" path="/error/400" responseMode="Redirect" />
  <error statusCode="404" path="/error/404" responseMode="Redirect" />
  <error statusCode="500" path="/error/500" responseMode="Redirect" />
  <error statusCode="501" path="/error/501" responseMode="Redirect" />
  <error statusCode="503" path="/error/503" responseMode="Redirect" />
</httpErrors>-->

I also tried to add <httpErrors existingResponse="PassThrough" />or move out of my code system.webServerto system.webusing nodes customErrors, but it seems that the user is locked up on the Internet. config has been read. The behavior remained the same for every change I tried.

How can i decide? Thanks

+4
1

, .

- Azure:

  • , .
  • .
  • , "" " ".

, Azure .

0

Source: https://habr.com/ru/post/1677388/


All Articles