# POST to static URL and CLOSE\_WAIT

**URL:** <https://www.ruby-forum.com/t/post-to-static-url-and-close-wait/198034>\
**Category:** NGINX\
**Created:** [October 25, 2010, 12:28pm UTC](https://www.ruby-forum.com/t/post-to-static-url-and-close-wait/198034 "2010-10-25T12:28:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/77aa72/32.png) [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Post date:** [October 25, 2010, 12:28pm UTC](https://www.ruby-forum.com/t/post-to-static-url-and-close-wait/198034/1 "2010-10-25T12:28:00Z")

</div>

Hi,  
we are using the following in our configuration to handle HTTP POST to  
static files:

…

# Allow POST to static URLs

error\_page 405 = $uri;  
…

This works, but during load, we start to see a lot of connections in  
CLOSE\_WAIT state,  
until we finally run out of connections.

Any idea why we see this and what can be done to avoid this?

We are running nginx/0.7.65 on Ubuntu 10.04:

/Jan

---

<div class="post-metadata">

**Author:** ![Jan\_Andersson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/59ef9b/32.png) [@Jan\_Andersson](https://www.ruby-forum.com/u/Jan_Andersson)\
**Post date:** [October 25, 2010, 12:48pm UTC](https://www.ruby-forum.com/t/post-to-static-url-and-close-wait/198034/2 "2010-10-25T12:48:47Z")

</div>

We use something like this and we don’t have problems

```
location ~*

```

^.+.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js)$  
{  
if ($request\_method !~ ^(GET|HEAD)$ ) {  
return 405;  
}

```
     root /var/www;

```

}

---

<div class="post-metadata">

**Author:** ![Jan\_Andersson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/59ef9b/32.png) [@Jan\_Andersson](https://www.ruby-forum.com/u/Jan_Andersson)\
**Post date:** [October 25, 2010, 5:50pm UTC](https://www.ruby-forum.com/t/post-to-static-url-and-close-wait/198034/3 "2010-10-25T17:50:10Z")

</div>

Thanks, but I’m not sure how something like this enables posting to  
static files?  
/Jan
