Sending location headers from a fastcgi application

Spil Games lists at
Wed Oct 15 15:58:15 MSD 2008

We're trying to migrate some internal fastcgi application from Lighttpd
to Nginx. The problem is relatively easy: the application sends a
'Location' header without sending a 'Status' header. Nginx will return a
200 in this scenario where Lighttpd returns a 302.

Now I could add sending of the Status header to the application. Easy
enough, but the CGI 1.1 spec says otherwise:

    The "Status" header field is used to indicate to the server
    what status code the server MUST use in the response message.
    It SHOULD NOT be sent if the script returns a "Location"
    header field.

I checked PHP fastcgi and it sure as hell does send both headers at the
same time (not following CGI 1.1 specs).

Lighttpd is following CGI 1.1 specs through this small snippet of code:

    /* CGI/1.1 rev 03 - */
    if ((con->parsed_response & HTTP_LOCATION) &&
        !(con->parsed_response & HTTP_STATUS)) {
        con->http_status = 302;

If Nginx claims to follow CGI 1.1 specifications (I'm not sure that it
does), shouldn't it return a 302 response by itself when a Location
header is being send (just like Lighttpd)?
Posted via

More information about the nginx mailing list