Default error_page for multiple vhosts

Mark Alan m6rkalan at gmail.com
Fri Feb 22 10:45:27 UTC 2013


On Fri, 22 Feb 2013 09:32:33 +0100, Alexander Nestorov
<alexandernst at gmail.com> wrote:
> I'm trying to set a default error_page for my entire nginx server (as
> http {
>     error_page 404 /var/www/default/404.html;
>     server {
>         root /var/www/mydomain.com/;
>     }
> }
> Is there any other way I could achieve what I'm trying?

What about soft linking it into wherever you want it?

# in the OS
  ln -s /var/www/default/404.html /var/www/mydomain.com/

#in Nginx config
  error_page 404 /404.html;

Regards,

M.



More information about the nginx mailing list