Welcome! Log In Create A New Profile

Advanced

Re: HTTP 505 error message supported by NGINX?

Francis Daly
August 04, 2015 06:52PM
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?

Cheers,

f
--
Francis Daly francis@daoine.org

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

HTTP 505 error message supported by NGINX?

nginxuser100 August 04, 2015 05:57PM

Re: HTTP 505 error message supported by NGINX?

B.R. August 04, 2015 06:06PM

Re: HTTP 505 error message supported by NGINX?

nginxuser100 August 04, 2015 06:19PM

Re: HTTP 505 error message supported by NGINX?

Francis Daly August 04, 2015 06:52PM

Re: HTTP 505 error message supported by NGINX?

nginxuser100 August 04, 2015 07:25PM

Re: HTTP 505 error message supported by NGINX?

B.R. August 04, 2015 07:34PM

Re: HTTP 505 error message supported by NGINX?

nginxuser100 August 05, 2015 01:29AM

Re: HTTP 505 error message supported by NGINX?

Francis Daly August 05, 2015 03:18AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 138
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready