Question

The questio is about configuring "Spaces".

Posted December 6, 2017 716 views
DigitalOcean

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?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
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.

Submit an Answer