In Apache to serve custom error pages I did something like so:
<IfModule mod_alias.c>
Alias /foo /web/share/error
<Directory /web/share/error>
Order allow,deny
Allow from all
Options -Indexes
</Directory>
</IfModule>
ErrorDocument 404 /foo/404.html
...
The server root would be something like /web/www.
So if someone typed http://website.com/agasdga and there was nothing there for it the server would display http://website.com/foo/404.html which would in reality be located at /web/share/error/404.html. I've been scratching my head trying to get this to work in nginx. What I have currently is:
error_page 404 /foo/404.html;
server
{
listen 80 default_server;
root /web/www;
location /foo/
{alias /web/share/error;}
...
}
Edited 1 time(s). Last edit at 05/12/2012 12:50PM by Khadgar.