Reputation: 836
When something goes wrong the server returns the default nginx 502 Server Error, I'd like to show my own server error page.
I put 502.html file to the template directory but it doesn't seem to work. It works for 404.html so I am sure I put it to the right directory.
Any ideas how to solve this problem or what could I miss?
Upvotes: 1
Views: 742
Reputation: 59219
Since 502 means "Bad Gateway", Django (or even the WSGI server in between) is not aware of the request at all. You can add a line similar to the following to your NginX configuration file:
error_page 502 /var/www/502.html;
Upvotes: 2