HTTP status codes missing description in header for proxy_pass

kgoess nginx-forum at nginx.us
Tue Jun 4 20:09:13 UTC 2013


> I guess the irregular response comes from your mod_perl backend?

Aha, from ngrep listening on port 8080 responding to nginx, it is indeed
missing the description:

T 10.200.1.59:8080 -> 10.200.1.59:57990 [AP]
  HTTP/1.1 404..Server: Apache/2.2.16 (Debian) mod_perl/2.0.4 Perl/v5.10.1

If apache is in the middle layer, instead of nginx, it looks like apache
fills in the status line

T 127.0.0.1:8082 -> 127.0.0.1:37887 [AP]
  HTTP/1.1 404 Not Found..Date: Tue, 04 Jun 2013 20:02:03 GMT..Server:
Apache/2.2.16 (Debian) mod_perl/2.0.4 Perl/v5.10.1..

but if nginx is in the middle, it just passes it straight through:

T 127.0.0.1:8083 -> 127.0.0.1:46829 [AP]
  HTTP/1.1 404..Server: nginx/1.2.1..

And sure enough, some pretty old cgi code needed this fix

 		if (! -e $file) {
 			bepress::Statsd->increment('viewcontent.error.native_not_found');
-			$self->out( $cgiutils->header( -status => 404 ) );
+			$self->out( $cgiutils->header( -status => '404 Not Found' ) );
 			$self->out( $cgiutils->start_html(

Thanks for the help!

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,239811,239869#msg-239869



More information about the nginx mailing list