Multiple 404 error pages

Igor Sysoev is at rambler-co.ru
Tue Oct 16 22:23:33 MSD 2007


On Tue, Oct 16, 2007 at 08:10:55PM +0200, Tim Michaud wrote:

> Is it possible to have a different 404 or 500 error page be shown based
> on the request path? For example, any failed request that started with
> "/admin" would get an error page that matched the layout of the admin
> layout while any other failed request would get the standard 500 error
> page.

   location / {
        ...
        error_page  404   /404.html;
   }

   location = /404.html {
        ...
   }

   location /admin {
        ...
        error_page  404   /admin/404.html;
   }

   location = /admin/404.html {
        ...
   }


-- 
Igor Sysoev
http://sysoev.ru/en/





More information about the nginx mailing list