When looking at the documentation for nginx's error_page directive, it seems that one has to manually list out every possible status code that nginx (or an upstream server) could return.
For example:
error_page 404 /404.html;
error_page 502 503 504 /50x.html;
error_page 403 http://example.com/forbidden.html;
error_page 404 = @fetch;
Is there anyway of producing a wildcard for ALL status codes that are not specified directly... For example:
error_page 404 /404.html;
error_page 5xx /50x.html;
or
error_page 404 /404.html;
error_page 502 503 504 /50x.html;
error_page @catchall /5xx.html;
It is not possible.
Moreover, it is not recommended to blindly list all codes, as