Nginx: Set up error pages

By manik March 23, 2008

Setting up custom error pages are needed whenever the app goes in maintenance or when the code gets crashed :P … In Nginx, its fairly simple but once when you know it.

Say your app is residing in /var/www/apps/example

Nginx configurations

say your existing configuration looks like…

add the error page configurations

Create the required html error page at /var/www/maintenance/example/500.html.
Now, restart the nginx to reload the configurations by issuing /etc/init.d/nginx restart.
And you are done!

Share this:

Leave a comment

Your email address will not be published. Required fields are marked *