Home > OS >  Does Nginx close client TCP connection before sending back the http response?
Does Nginx close client TCP connection before sending back the http response?

Time:12-16

I found the following documentation from Nginx website itself: enter image description here

Question: The above point is not correct, right? Since HTTP is a synchronous protocol, after a client sends a request over an established TCP connection with the server (here Nginx reverse proxy), the client expects a response on that TCP connection. So if this is the case Nginx server cannot close the connection just after receiving the request, correct? Shouldn't the Nginx server keep the connection still open until it gets a response from upstream server connection and relays back that data over the same client connection?

CodePudding user response:

I believe the way that paragraph is phrased is inaccurate.

The NGINX blog post mentioned in the question is referencing the behavior of UDP in the context of Direct Server Return (DSR). It is not part of their official documentation. I suspect that the author didn't do a good job of communicating how a conventional layer 7 reverse proxy connection works because they were focusing on explaining how DSR works.

  • Related