HEAD and Nginx nginx-0.6.36-1.el5

Maxim Dounin mdounin at mdounin.ru
Fri Sep 11 14:01:10 MSD 2009


Hello!

On Fri, Sep 11, 2009 at 04:48:46AM -0400, xmichielx wrote:

> Hi Igor,
> 
> Thanks, do you know why the HEAD is returning a 301 with Apache and a 404 with Nginx?
> 
> The nginx access.log:
> 172.23.3.14 - - [10/Sep/2009:20:45:12 +0200] HEAD /web/MYCE.htm HTTP/1.1 "404" 0
>  "-" "Mozilla/4.06  (WinNT; I)" "172.21.0.5, 172.21.0.5"
> 172.21.0.5 - - [10/Sep/2009:20:45:12 +0200] HEAD /MYCE.htm HTTP/1.0 "404" 0 "-"
> "Mozilla/4.06  (WinNT; I)" "-"
> 
> The apache log:
> 
> 172.21.0.5 - - [10/Sep/2009:20:12:56 +0200] "HEAD /MYLER.htm HTTP/1.0" 404 - "-" "Mozilla/4.06  (WinNT; I)"
> 172.21.0.5 - - [10/Sep/2009:20:12:56 +0200] "HEAD /MYCE.htm HTTP/1.0" 404 - "-" "Mozilla/4.06  (WinNT; I)"

So it's Apache returned 404, right?

Looks like the problem is incorrect virtual host in Apache was 
picked up.  Probably you just need correct Host header to be 
passed into Apache.  By default nginx uses upstream name, you 
probably need

    proxy_set_header  Host  $host;

in nginx.conf.

Maxim Dounin

> stmycew01.hf.info.nl - - [10/Sep/2009:20:12:58 +0200] "GET /404.html HTTP/1.0" 200 6507 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)l"
> stmycew01.hf.info.nl - - [10/Sep/2009:20:12:58 +0200] "GET /404.html HTTP/1.0" 200 6507 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)l"
> stmycew01.hf.info.nl - - [10/Sep/2009:20:12:58 +0200] "HEAD /web/MYLER.htm HTTP/1.0" 404 - "-" "Mozilla/4.06  (WinNT; I)"
> 
> 
> We also see some Apache DNS lookup proxy messages:
>    proxy: DNS lookup failure for: 172.23.3.14, 172.23.3.14 returned by /MYLER.htm
>    proxy: DNS lookup failure for: 172.23.3.14, 172.23.3.14 returned by /MYCE.htm
>    proxy: DNS lookup failure for: 172.23.3.14, 172.23.3.14 returned by /MYLER.htm
> 
> 
> Only apache on port 80 (normal setup):
> 
> stmycew01.hf.info.nl - - [11/Sep/2009:10:42:57 +0200] "HEAD /MYLER.htm HTTP/1.1" 200 - "-" "Mozilla/4.06  (WinNT; I)"
> stmycew01.hf.info.nl - - [11/Sep/2009:10:42:57 +0200] "HEAD /web/MYLER.htm HTTP/1.1" 200 - "-" "Mozilla/4.06  (WinNT; I)"
> 
> 
> If you want I can post the nginx.conf and the virtual host?
> 
> Kind regards and thanks for your kind help :)
> 
> Michiel
> 
> Posted at Nginx Forum: http://forum.nginx.org/read.php?2,6366,6435#msg-6435
> 
> 





More information about the nginx mailing list