6 messages in ru.sysoev.nginxRe: error_page broken in 0.4.5?
FromSent OnAttachments
Bob IppolitoOct 2, 2006 7:27 pm 
Igor SysoevOct 2, 2006 9:31 pm 
Bob IppolitoOct 2, 2006 10:02 pm 
Igor SysoevOct 2, 2006 10:10 pm 
Bob IppolitoOct 2, 2006 11:03 pm 
Igor SysoevOct 2, 2006 11:10 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: error_page broken in 0.4.5?Actions...
From:Bob Ippolito (bob-@public.gmane.org)
Date:Oct 2, 2006 11:03:11 pm
List:ru.sysoev.nginx

On 10/2/06, Igor Sysoev <is-G@public.gmane.org> wrote:

On Mon, 2 Oct 2006, Bob Ippolito wrote:

On 10/2/06, Igor Sysoev <is-G@public.gmane.org> wrote:

On Mon, 2 Oct 2006, Bob Ippolito wrote:

I just upgraded to 0.4.5, and it seems that error_page no longer works correctly. If I specify "error_page 404 404.html;" then it will do a Location redirect to 404.html, but if I specify "error_page /404.html;" then I will just get the default nginx 404 page.

In 0.4.2 I could use "error_page /404.html;" and get the contents of 404.html (this is the documented behavior).

$ curl -I http://127.0.0.1/nothere HTTP/1.1 404 Not Found Server: nginx/0.4.5 Date: Tue, 03 Oct 2006 02:26:21 GMT Content-Type: text/html Content-Length: 168 Connection: keep-alive

$ curl -I http://127.0.0.1/nothere HTTP/1.1 302 Moved Temporarily Server: nginx/0.4.5 Date: Tue, 03 Oct 2006 02:26:50 GMT Content-Type: text/html Content-Length: 160 Connection: keep-alive Location: 404.html

"error_page /404.html;" is invalid directive. If you run "nginx -t", it should show you: "invalid number arguments in directive "error_page"". The same error should be in error file after -HUP and nginx will run with previous configiration.

The correct directives are error_page 404 /404.html; or error_page 403 404 /404.html;

You're right, I was in a hurry and typing it from memory. It actually says "error_page 404 /404.html;" but it still does not work. The configuration is valid syntax.

If you request just /404.html, do you the right page ?

Yes, that works fine.

-bob