NGINX not proxying request to upstream if client send TCP FIN immediately after sending data

1.2k Views Asked by At

I have client (10.1.30.29), that sends HTTP requests to server (port 6500, 10.1.30.11-127.0.0.1) behind NGINX reverse proxy (port 80, 10.1.30.11-127.0.0.1). Most of the times (~5 of 6), server is not receiving requests. Digged into with wireshark, I found that client sends TCP FIN ACK packet after it sends data and before NGINX responded with TCP ACK for data: enter image description here

Data transmission from NGINX to server starts, but ends before any data was transferred.

In other (correct) case data is fully transmitted: enter image description here

Key difference from first case is that NGINX managed to send ACK on data before client have sent FIN ACK.

In both cases access log in NIGNX contains records about requests; error log is empty.

Unfortunately, I barely can influence the client's behavior, but I know, that other HTTP server implementations can work with request data even if client incorrect closes TCP transmission. The question is if there any way to force NGINX to ignore such incorrect client's behavior and always proxy request data?

P. S. already tried postpone_output NGINX option - no luck.

1

There are 1 best solutions below

0
On BEST ANSWER

Found two solutions, that seems pretty similar and valid (in my case):

  1. proxy_ignore_client_abort on;
    
2.  proxy_http_version 1.1;
    proxy_request_buffering off;