Report this

What is the reason for this report?

The questio is about configuring "Spaces".

Posted on December 6, 2017

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?



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

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.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.