nginx won't serve an error_page in a subdirectory of the document root

Try adding

proxy_intercept_errors on;

or

fastcgi_intercept_errors on;

in server block depending of your configuration.

This sort of config is working ok:

  error_page   500 502 503 504  /500.html;
    location = /500.html {
        root   /home/static/pages;
    }