nginx - Can I configure a global error document?
Use the magic of an include directive to specify all the necessary boilerplate, then just include /etc/nginx/standard-error-pages.conf
in each vhost (make it part of the standard vhost template in your config management system). This also makes it real easy to override the error pages for a specific vhost (by not putting the include into that vhost config).