error_page and virtual hosts

Drazen Milosevic dmilosevic at
Mon Mar 24 18:16:34 MSK 2008

Hi everyone,

I have a lot of virtual hosts and I was wondering is there a way to setup this 
once in the main nginx.conf file.

server {
listen x.x.x.x:80;
   root /VDOMAINS/domain/www;
   server_name domain;
   server_name domain;
   error_log /path;
   access_log /path;
location ~ ^/(images|javascript|js|css|flash|media|static)/  {
   error_page   404  /404.html;
   location = /404.html {
        root   /VDOMAINS/htdocs/errors;
   error_page   500 502 503 504  500.html;
   location  = 500.html {
        root   /VDOMAINS/htdocs/errors;
include /VDOMAINS/proxy.conf;

These error_page directives are set individualy in every virtual host, but I 
was hoping there was a more ellegant solution.

Drazen Milosevic
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <>

More information about the nginx mailing list