3

I'm trying to get 403 responses to be exactly identical to 404 ones.

Not sure if there's a proper way to do it, but setting
error_page 403 404
is my current method.

Which works, but it rewrites the url to mysite.com/404 for 403's
while regular 404's leave the url alone.

Oh and I don't have any 4XX custom pages set up and I deleted the default nginx one.

House3272
  • 169
  • 1
  • 4

1 Answers1

4

The nginx documentation clearly says that if you want to change the response code, you use =response. For example:

error_page 403 =404 /url;

Note that making this change requires specifying a URL to serve, so you'll have to make something up.

Michael Hampton
  • 237,123
  • 42
  • 477
  • 940