# Connection reset by peer on first request

**URL:** <https://www.ruby-forum.com/t/connection-reset-by-peer-on-first-request/224524>\
**Category:** NGINX\
**Created:** [November 15, 2012, 12:27am UTC](https://www.ruby-forum.com/t/connection-reset-by-peer-on-first-request/224524 "2012-11-15T00:27:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![aris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@aris](https://www.ruby-forum.com/u/aris)\
**Post date:** [November 15, 2012, 12:27am UTC](https://www.ruby-forum.com/t/connection-reset-by-peer-on-first-request/224524/1 "2012-11-15T00:27:40Z")

</div>

Hi,

I’m using Nginx with php-cgi. A problem arose recently where if you  
have  
not used my site for a few minutes and then go to it, the first request  
is  
always ‘connection reset by peer’. If you refresh, everything functions  
normally until you leave for a few minutes and go to another link. It  
happens 100% of the time. Does anyone know what could be the problem?

All I get in error log with debug on are these messages:  
2012/11/14 17:25:46 [info] 3454#0: \*2516 client prematurely closed  
connection while reading client request line, client: \*, server:

> **[Website Domain Names, Online Stores & Hosting](https://www.domain.com/)**
>
> Finding the perfect website domain is as easy as 1-2-3. Buy a domain name, build and host a website, and enjoy our professional online marketing tools.

Also, these coincide with the 400 bad request errors in access.log. I  
have  
tried restart dns server, nginx, php-cgi, etc, but to no avail.

Posted at Nginx Forum:

> **[Connection reset by peer on first request](https://forum.nginx.org/read.php?2,232817,232817#msg-232817)**
>
> Hi, I'm using Nginx with php-cgi. A problem arose recently where if you have not used my site for a few minutes and then go to it, the first request is always 'connection reset by peer'. If you refresh, everything functions normally until you leave...
