The questio is about configuring "Spaces".

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?

Submit an answer

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!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

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.