I have a WSGI server behind by nginx. Say I bring the WSGI instance down for maintenance/update, is there a nice way of nginx automatically serving up any requests to that application with a specified HTML file?

1 Answer 1


Create a static page /50x.html with your desired content, and then add something like this to your nginx configuration:

error_page 502 503 504 /50x.html;

The error_page directive is used to override nginx's internal error pages.

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.