January 11, 2015 01:37AM
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.
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: 171
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