About the return http status 203

Weibin Yao yaoweibin at gmail.com
Wed Apr 3 04:09:25 UTC 2013


Hi,

Today In our test box I noticed that nginx sent bad response with 203
response. You can reproduce the problem with the return directive:

location / {
    return 203;
}

And the response looks like:

HTTP/1.1
Server: nginx/1.3.14
Date: Wed, 03 Apr 2013 03:54:38 GMT
Content-Type: application/octet-stream
Content-Length: 0
Connection: keep-alive

This is actually not an illegal HTTP/1.1 response.

I noticed the related code in the ngx_http_header_filter_module.c:

 53 static ngx_str_t ngx_http_status_lines[] = {
 54
 55     ngx_string("200 OK"),
 56     ngx_string("201 Created"),
 57     ngx_string("202 Accepted"),
 58     ngx_null_string,  /* "203 Non-Authoritative Information" */
 59     ngx_string("204 No Content"),
 60     ngx_null_string,  /* "205 Reset Content" */
 61     ngx_string("206 Partial Content"),

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?

Thanks.
-- 
Weibin Yao
Developer @ Server Platform Team of Taobao
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx-devel/attachments/20130403/5edb5410/attachment.html>


More information about the nginx-devel mailing list