<div dir="ltr"><div>Could someone comment on my question below. What does it mean when the connections are stuck in 'Writing' state? Since the client has received the response, why is the nginx still stuck trying to write something. Any help in debugging or what to look for is greatly appreciated. Thanks.</div><div><br></div><div>Dk.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jul 23, 2019 at 6:17 PM Dk Jack <<a href="mailto:dnj0496@gmail.com">dnj0496@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hi,<div>In my module, I am capturing the request body to check if the body contains some specific content. If the body does not contain the specific content, I pass on the request without modification. Otherwise, I send a HTTP_FORBIDDEN. I am using 'ngx_http_read_client_request_body' call to capture the body. Everything seems to be working fine. My requests are forwarded to the orgin server and my client is receiving the response from the origin server correctly.</div><div><br></div><div>However, what I notice is that the nginx is not releasing the client side (see below). Nginx status module reports same number of active connections in 'writing' state. Is there something special I need to do in my module to ensure the connections are closed properly when I am capturing body? Any help is greatly appreciated. Thanks.</div><div><br></div><div>Regards,</div><div>Dk.</div><div><br></div><div><div><font face="courier new, monospace">[centos@ip-10-50-18-73 nginx]$ netstat -n | grep CLOSE_WAIT | head -4</font></div><div><font face="courier new, monospace">tcp 1 0 <a href="http://10.50.18.73:443" target="_blank">10.50.18.73:443</a> <a href="http://10.50.30.239:60116" target="_blank">10.50.30.239:60116</a> CLOSE_WAIT</font></div><div><font face="courier new, monospace">tcp 1 0 <a href="http://10.50.18.73:443" target="_blank">10.50.18.73:443</a> <a href="http://10.50.30.239:60092" target="_blank">10.50.30.239:60092</a> CLOSE_WAIT</font></div><div><font face="courier new, monospace">tcp 1 0 <a href="http://10.50.18.73:443" target="_blank">10.50.18.73:443</a> <a href="http://10.50.30.239:60112" target="_blank">10.50.30.239:60112</a> CLOSE_WAIT</font></div><div><font face="courier new, monospace">tcp 1 0 <a href="http://10.50.18.73:443" target="_blank">10.50.18.73:443</a> <a href="http://10.50.30.239:60054" target="_blank">10.50.30.239:60054</a> CLOSE_WAIT</font></div></div><div><div><font face="courier new, monospace">[centos@ip-10-50-18-73 nginx]$ netstat -n | grep CLOSE_WAIT | wc -l</font></div><div><font face="courier new, monospace">35</font></div><div><font face="courier new, monospace">[centos@ip-10-50-18-73 nginx]$ [centos@ip-10-50-18-73 nginx]$ curl -k <a href="https://localhost/nginx_status" target="_blank">https://localhost/nginx_status</a></font></div><div><font face="courier new, monospace">Active connections: 37</font></div><div><font face="courier new, monospace">server accepts handled requests</font></div><div><font face="courier new, monospace"> 41 41 472</font></div><div><font face="courier new, monospace">Reading: 0 Writing: 36 Waiting: 1</font></div></div><div><font face="courier new, monospace">[centos@ip-10-50-18-73 nginx]$<br></font></div><div><font face="courier new, monospace"><br></font></div><div><br></div></div></div></div></div></div></div>
</blockquote></div></div>