0

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?

masegaloeh
  • 17,978
  • 9
  • 56
  • 104
user1561108
  • 185
  • 1
  • 1
  • 5

1 Answers1

2

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.

Michael Hampton
  • 237,123
  • 42
  • 477
  • 940