<div dir="ltr"><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">The HTTP specification states every request shall receive a response.<br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">Your backend closes the connection while nginx is awaiting/reading the headers.<br><br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">The problem definitely comes from your backend. You could use tcpdump between nginx and your backend to record what they say to each other.<br></div><div class="gmail_extra"><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">​Try to correlate logs from nginx with logs from your backend.​</div><div><div class="gmail_signature"><font size="1"><span style="color:rgb(102,102,102)">---<br></span><b><span style="color:rgb(102,102,102)">B. R.</span></b><span style="color:rgb(102,102,102)"></span></font></div></div>
<br><div class="gmail_quote">On Thu, Mar 3, 2016 at 11:57 AM, stefws <span dir="ltr"><<a href="mailto:nginx-forum@forum.nginx.org" target="_blank">nginx-forum@forum.nginx.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">My config btw:<br>
<br>
user  imail;<br>
worker_processes  auto;<br>
daemon on;<br>
master_process on;<br>
error_log  logs/mos_error.tcp  debug_tcp;<br>
error_log  logs/mos_error.log;<br>
pid        /opt/imail/nginx/logs/mos_nginx.pid;<br>
worker_rlimit_nofile 200000;<br>
worker_rlimit_core  500M;<br>
working_directory   /opt/imail/nginx;<br>
events {<br>
    worker_connections  25000;<br>
    use epoll;<br>
    multi_accept off;<br>
}<br>
http {<br>
    log_format testlogs '$remote_addr - $remote_user [$time_local]  '<br>
     '"$request" $status $body_bytes_sent '<br>
     '"$http_referer" "$upstream_addr" '<br>
     '$request_time $upstream_response_time';<br>
    access_log logs/mos_access.log;<br>
    sendfile on;<br>
    keepalive_requests 500000;<br>
    keepalive_timeout 20s;<br>
    tcp_nopush on;<br>
    tcp_nodelay on;<br>
    client_body_buffer_size 128k;<br>
    client_body_temp_path /dev/shm/mos_nginx/client_temp 1 2;<br>
    open_file_cache max=25000 inactive=30s;<br>
    open_file_cache_valid    60s;<br>
    open_file_cache_min_uses 2;<br>
    open_file_cache_errors   on;<br>
    upstream mosgenericbackend {<br>
        server mss1:8081;<br>
        server mss2:8081;<br>
        server mss3:8081;<br>
        server mss4:8081;<br>
        healthcheck_enabled;<br>
        healthcheck_delay 1000;<br>
        healthcheck_timeout 1000;<br>
        healthcheck_failcount 2;<br>
        healthcheck_send 'GET /mxos/monitor HTTP/1.0';<br>
        keepalive 300;<br>
    }<br>
    server {<br>
        listen 8081;<br>
        keepalive_timeout 600s;<br>
        client_max_body_size 0;<br>
        location /mxos/ {<br>
            proxy_http_version 1.1;<br>
            proxy_set_header Connection "";<br>
            proxy_pass <a href="http://mosgenericbackend" rel="noreferrer" target="_blank">http://mosgenericbackend</a>;<br>
            proxy_connect_timeout 2;<br>
            more_set_headers "Content-Type: application/json";<br>
        }<br>
        location /mxos/health_status {<br>
            healthcheck_status;<br>
        }<br>
        proxy_connect_timeout 60;<br>
        proxy_read_timeout  30;<br>
        proxy_send_timeout 60;<br>
    }<br>
}<br>
<br>
My [vendor patched/supplied due to application specific load<br>
balancing+health check] nginx version:<br>
<br>
# /opt/imail/nginx/sbin/nginx -V<br>
nginx version: nginx/1.7.4<br>
built by gcc 3.4.6 20060404 (Red Hat 3.4.6-3)<br>
TLS SNI support disabled<br>
configure arguments: --with-debug<br>
--add-module=/bld/current/emailmx90_git_blds/emailmx90_contrib_shared/contrib/nginx_1.7.4/source/addons/healthcheck_nginx_upstreams-master<br>
--add-module=/bld/current/emailmx90_git_blds/emailmx90_contrib_shared/contrib/nginx_1.7.4/source/addons/headers-more-nginx-module-0.23<br>
--add-module=/bld/current/emailmx90_git_blds/emailmx90_contrib_shared/contrib/nginx_1.7.4/source/addons/yaoweibin-nginx_tcp_proxy_module-f2156ef<br>
<br>
Posted at Nginx Forum: <a href="https://forum.nginx.org/read.php?2,265031,265032#msg-265032" rel="noreferrer" target="_blank">https://forum.nginx.org/read.php?2,265031,265032#msg-265032</a><br>
<div class="HOEnZb"><div class="h5"><br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" rel="noreferrer" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br>
</div></div></blockquote></div><br></div></div>