Welcome! Log In Create A New Profile

Advanced

Re: Nginx behind a reverse proxy sending 499

Maxim Dounin
January 12, 2015 09:06AM
Hello!

On Sun, Jan 11, 2015 at 01:37:31AM -0500, ppwm wrote:

> To debug the issue further, I wrote a simple Java based HTTP client. This
> client would open a socket to the nginx server, write the request line (GET
> / HTTP/1.1), write the host header, write the Connection:close header and
> commit the request. While committing the write the CRLF character twice.
>
> In this setup, I tested by having a proxy pass to www.google.com and not
> having a proxy pass (nginx servers the default index.html.
>
> If there is no proxy pass, nginx never gives a 499 status code. Even if I do
> Socket.shutdownOutput(), nginx give a valid 200 response. This is
> irrespective of the Connection header (keepalive/close).
>
> If there is proxy pass, I get a valid response if I don't do
> Socket.shutdownOutput(). But if I do Socket.shutdownOutput(), I get 499
> irrespective of Connection header (keepalive/close). This implies that nginx
> is treating client's Socket.shutdownOutput() as client closing the
> connection despite all data being written to the socket.

In HTTP, it's generally a bad idea to shutdown the socket before
you've got the response. While not strictly prohibited, the
server will likely think that the client bored waiting for a
response and closed the connection, so there is no need to return
any response. Google for something like "http tcp half-close" for
more details.

The "proxy_ignore_client_abort" directive can be used if you want
nginx to be compatible with such clients for some reason, see
here:

http://nginx.org/r/proxy_ignore_client_abort

--
Maxim Dounin
http://nginx.org/

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

Nginx behind a reverse proxy sending 499

ppwm January 10, 2015 10:16AM

Re: Nginx behind a reverse proxy sending 499

ppwm January 11, 2015 01:37AM

Re: Nginx behind a reverse proxy sending 499

Maxim Dounin January 12, 2015 09:06AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 253
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready