How to setup custom error page

I want to use nginx to proxy 2 web server and I want to use custom error
page on nginx box.
The following config doesn’t work.

error_page 404 /web_errors/404.html;
error_page 503 /web_errors/503.html;
error_page 502 /web_errors/502.html;

server {
listen 80;
server_name www.mydomain.com;

location ^~ /web_errors/ {
internal;
root /foo/errordoc/html;

    }
    location / {
       proxy_redirect  off;
       proxy_redirect  default;
       proxy_pass http://10.10.1.2;
    }

}

Please help me to find out my mistake.

Thanks

Yours,
DeltaY

sorry, there is “proxy_intercept_errors on;” in my original config
already.
I forgot to paste it.
:slight_smile:
2008/8/13 Delta Y. [email protected]

ooo, I make a stupid mistake.

when I move the error pages from /foo/errordoc/html to
/foo/errordoc/html/web_errors

It works!

shame on me for such a mistake.

2008/8/13 Delta Y. [email protected]