<div dir="ltr">Hi,<div><br></div><div>Today In our test box I noticed that nginx sent bad response with 203 response. You can reproduce the problem with the return directive:</div><div><br></div><div style>location / {</div>
<div style> return 203;</div><div style>}</div><div style><br></div><div style>And the response looks like:</div><div style><br></div><div style><div>HTTP/1.1</div><div>Server: nginx/1.3.14</div><div>Date: Wed, 03 Apr 2013 03:54:38 GMT</div>
<div>Content-Type: application/octet-stream</div><div>Content-Length: 0</div><div>Connection: keep-alive</div><div><br></div></div><div style>This is actually not an illegal HTTP/1.1 response.</div><div style><br></div><div>
I noticed the related code in the ngx_http_header_filter_module.c:</div><div><br></div><div><div> 53 static ngx_str_t ngx_http_status_lines[] = {</div><div> 54</div><div> 55 ngx_string("200 OK"),</div><div> 56 ngx_string("201 Created"),</div>
<div> 57 ngx_string("202 Accepted"),</div><div> 58 ngx_null_string, /* "203 Non-Authoritative Information" */</div><div> 59 ngx_string("204 No Content"),</div><div> 60 ngx_null_string, /* "205 Reset Content" */</div>
<div> 61 ngx_string("206 Partial Content"),</div><div><br></div><div style>It seems this behaviour is expected intentionally. It does not follow the RFC 2616. If we replace it to be the meaningful status code. Is there any problem?</div>
<div style><br></div><div style>Thanks.</div>-- <br>Weibin Yao<br>Developer @ Server Platform Team of Taobao
</div></div>