Error_page and virtual hosts

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 wrote:

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

Have you seen the wildcard example here?

http://wiki.codemongers.com/NginxVirtualHostExample

-Drew

On Monday 24 March 2008 16:43:21 Drew R. wrote:

Drazen Milosevic wrote:

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

Have you seen the wildcard example here?

http://wiki.codemongers.com/NginxVirtualHostExample

-Drew

This doesn’t work for me because I am migrating existing Apache setup to
Nginx
and I have some “predefined” things such as paths to webroot directories
for
each virtual host. And unfortunatly they are not in form
of /PATH/TO/WEBROOT/www.domain.com/ but as
/PATH/TO/WEBROOT/ftp_username/


Drazen Milosevic
VeratNet

 19, Alekse Nenadovica Street, Belgrade, Serbia
 IT - IT Platforms and Security Department
 Senior System A.

Phone: Â Â Â Â Â +381 11 24 33333
Fax: Â Â Â Â Â Â +381 11 3442 504
E-mail: Â Â Â Â [email protected]
Internet: Â Â Â http://www.verat.net

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs