# Response with error code

**URL:** <https://www.ruby-forum.com/t/response-with-error-code/213234>\
**Category:** NGINX\
**Created:** [October 27, 2011, 10:28am UTC](https://www.ruby-forum.com/t/response-with-error-code/213234 "2011-10-27T10:28:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [October 27, 2011, 10:28am UTC](https://www.ruby-forum.com/t/response-with-error-code/213234/1 "2011-10-27T10:28:17Z")

</div>

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 has OK status

Posted at Nginx Forum:

> **[Response with error code](https://forum.nginx.org/read.php?2,217395,217395#msg-217395)**
>
> 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...
