Welcome! Log In Create A New Profile

Advanced

Response with error code

Posted by amastr 
Response with error code
October 25, 2011 04:59AM
Hi, all.

I need a help in the following question.
I send a request to the nginx server and I need to support only 1.1 version of the http protocol. If version is differ from "1.1", the error code should be sent in the response.
For this purpose I set "err_status" parameter of the ngx_http_request_t to error code and then call ngx_http_discard_request_body(ngx_http_request_t *r);
After that I call ngx_http_send_header(ngx_http_request_t *r) and ngx_http_output_filter(ngx_http_request_t *r, ngx_chain_t *chain); (where chain is NULL). But in this case client receives 0 bytes in the response.

Could you help me to find a problem?

NOTE: If version is set to "1.1" in the request, the response is successfully sent and have OK status
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 174
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