The questio is about configuring "Spaces".

December 6, 2017 259 views

Is there a way to change error code for response. For example if there is no file i would like to get 303 instead of 403?

1 Answer

There is no way to change the error codes that you receive.

Also 403 is a forbidden error code, while 303 is used more of a redirect to a new URI, most commonly associated with the completion of a POST request, so it is breaking standard protocol.

However, if you really felt compelled to redirect error codes you can setup a proxy such as nginx to route requests for you. So that instead of hitting Spaces directly, you would hit nginx, which would then route your request to Spaces and if it got a 403 then you can instead issue a 303.

Have another answer? Share your knowledge.