HTTP status codes missing description in header for proxy_pass

kgoess nginx-forum at
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 -> [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 -> [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 -> [AP]
  HTTP/1.1 404..Server: nginx/1.2.1..

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

 		if (! -e $file) {
-			$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:,239811,239869#msg-239869

More information about the nginx mailing list