How to test nginx errors?

nginx

Solution

 server {
     root /path/to/site
     error_page 504 502 500 = /html/error/500.html;

     location /get_error {
         return 500;
     }
 }

See the docs: http://nginx.org/en/docs/http/ngx_http_rewrite_module.html

Problem

I'm trying to trigger an nginx error to test my error pages. This is what I tried: ``` server { // ... root /path/to/site error_page 504 502 500 = /html/error/500.html; # absolute path: /path/to/site/html/error/500.html return 500; } ``` But I keep getting the default nginx error. Testing the html is not enough, I wanna make sure that nginx will show the correct error pages. Any ideas?

Original source