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.


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.

  • Of course, it would help if I would get the answer right, too. – Michael Hampton Oct 3 '16 at 1:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.