Welcome! Log In Create A New Profile

Advanced

Re: Changing HTTP status from FastCGI

September 16, 2010 04:12PM
On Wed, Sep 15, 2010 at 08:23:31PM -0400, tdebber wrote:

> Hello,
>
> I am trying to change the HTTP status that is sent when I send a
> response to a FastCGI query. In the nginx configuration file, I have
>
> fastcgi_pass_header Status;

You should not pass Status header line.

> When generating my return stream, which is done in C++, the first part
> of response is:
> "Status: 201\r\n"
> I have also tried:
> "Status: 201 Created\r\n"
> as well as different combinations of \n and \r\n following the header.
> In all cases, HTTP/1.1 200 OK is set as the Status and the body of the
> response contains the string I've tried to use as my header. Any hints
> as to what I may be doing wrong?

You should seperate response header and body using additional "\r\n":
----
Status: 201
Content-Type: text/html

some body text
----

If you send only Status without other headers, you need to change:

- "Status: 201\r\n"
+ "Status: 201\r\n\r\n\"


--
Igor Sysoev
http://sysoev.ru/en/

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

Changing HTTP status from FastCGI

tdebber September 15, 2010 08:23PM

Re: Changing HTTP status from FastCGI

Igor Sysoev September 16, 2010 04:12PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 75
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready