HTTP 505 error message supported by NGINX?

Francis Daly francis at
Tue Aug 4 22:49:54 UTC 2015

On Tue, Aug 04, 2015 at 06:19:03PM -0400, nginxuser100 wrote:

Hi there,

> I have my FCGI server send "HTTP/1.1 505 Version Not Supported\r\nStatus:
> 505 Version Not Supported\r\n\r\n".
> In nginx.conf, I have:
>           fastcgi_intercept_errors on;
>           error_page 505 /errpage;
>           location /errpage {
>                      try_files /version_not_supported.html =505;
>           }
> If version_not_supported.html is not found, I expected nginx to display "505
> HTTP Version Not Supported" on the browser page, and to return "Status Code:
> 505 HTTP Version Not Supported" in the HTTP response. Instead, I got a blank
> page, and the HTTP response shows a Status code of "505 OK".

I think that you can control the HTTP status code that nginx returns,
and you can control the body content returned with the response; but
you cannot control the "reason phrase" that nginx puts on the status line.

So nginx can be told to return (for example) "HTTP/1.1 505 " with the
body content that you choose. If that is good enough for what you want,
you won't need to go beyond nginx.conf to achieve it.

(To do that, you could replace "=505" with "@my505", and then in
"location @my505" do "return 505 my_body_content". I'm sure that other
ways of achieving the same thing exist too.)

What the browser chooses to do with the 505 response is its business --
perhaps it will show its own "505" page instead of what nginx sent;
or perhaps it will show exactly what nginx sent.

> Note NGINX displays the correct error message and Status code for other
> error codes such as 400, 401, 403, 404, 500, etc. Just for 505, NGINX would
> not return the proper error message.

I think that nginx returns its hard-coded "reason phrase" for each of
those status codes. It happens not to have one for 505, so it returns
the empty one.

Or do you have a config when you can control the reason phrase for those
status codes?


Francis Daly        francis at

More information about the nginx mailing list