Welcome! Log In Create A New Profile

Advanced

HTTP status codes missing description in header for proxy_pass

June 03, 2013 07:07PM
We're using nginx as a middle layer in front of our application server (mod_perl). When mod_perl returns an error page, the HTTP status line is missing the "reason phrase" after the status code, like "Not Found", e.g.

HTTP/1.1 404
Server: nginx/1.2.1
...etc

should be

HTTP/1.1 404 Not Found
...etc...

AFAICT, the HTTP spec requires at least a space after the status code:

---------------------------------------------
http://www.w3.org/Protocols/rfc1945/rfc1945
The first line of a Full-Response message is the Status-Line,
consisting of the protocol version followed by a numeric status code
and its associated textual phrase, with each element separated by SP
characters. No CR or LF is allowed except in the final CRLF sequence.

Status-Line = HTTP-Version SP Status-Code SP Reason-Phrase CRLF

Since a status line always begins with the protocol version and
status code

"HTTP/" 1*DIGIT "." 1*DIGIT SP 3DIGIT SP

(e.g., "HTTP/1.0 200 "),
---------------------------------------------

Reason-Phrase = *<TEXT, excluding CR, LF>

---------------------------------------------

The reason we noticed is that putting Perlbal in front of nginx got the status rejected, since Perlbal is written to strictly follow the spec:

------------------------------------------------
return fail("Bogus response line") unless
$self->{responseLine} =~ m!^HTTP\/(\d+)\.(\d+)\s+(\d+)(?:\s+(.*))$!;
------------------------------------------------

Is this a bug in nginx, or a configuration issue that we can fix? The patch to Perlbal is simple enough, is it worth looking for a patch to nginx? Or did we miss something else entirely?
Subject Author Posted

HTTP status codes missing description in header for proxy_pass

kgoess June 03, 2013 07:07PM

RE: HTTP status codes missing description in header for proxy_pass

Lukas Tribus June 03, 2013 07:20PM

Re: RE: HTTP status codes missing description in header for proxy_pass

kgoess June 04, 2013 04:09PM

Re: HTTP status codes missing description in header for proxy_pass

Maxim Dounin June 04, 2013 06:58AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 154
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready