Custom Bad Gateway Page with Nginx

There are three pieces that must be in place in order for your custom error page to display instead of the generic “Bad Gateway” error.

  1. You must create an html file named something like “500.html” and place it in the root. In the case of Rails running behind Nginx, this means putting it at public/500.html.

  2. You must have a line in your config file that points at least the 502 errors to that 500.html page like this:

    error_page 502 /500.html;
    
  3. You must have a location block for /500.html in your config file. If your root is already defined, this block can be empty. But the block must exist nonetheless.

    location /500.html{
    }
    

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)