# The quesion will be kill me

**URL:** <https://www.ruby-forum.com/t/the-quesion-will-be-kill-me/225543>\
**Category:** NGINX\
**Created:** [January 14, 2013, 4:02pm UTC](https://www.ruby-forum.com/t/the-quesion-will-be-kill-me/225543 "2013-01-14T16:02: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:** [January 14, 2013, 4:02pm UTC](https://www.ruby-forum.com/t/the-quesion-will-be-kill-me/225543/1 "2013-01-14T16:02:40Z")

</div>

Using nginx make proxy server, the backend server are nginx,apache  
Sometimes,the web is not ok !

An error occurred.  
Sorry, the page you are looking for is currently unavailable.  
Please try again later.

If you are the system administrator of this resource then you should  
check  
the error log for details.

Faithfully yours, nginx.

Moretimes the web is ok，little times is error…  
The nginx error log is:  
2013/01/14 16:02:26 [error] 31316#0: \*1154349 recv() failed (104:  
Connection  
reset by peer) while reading response header from upstream, client:  
61.186.137.140, server: [m.xx.cn](http://m.xx.cn), request: “GET  
/pnp4nagios/index.php/graph?host=sxcq-web&srv=PING HTTP/1.1”, upstream:  
“[http://10.2.4.10:80/pnp4nagios/index.php/graph?host=sxcq-web&srv=PING](http://10.2.4.10:80/pnp4nagios/index.php/graph?host=sxcq-web&srv=PING)”,  
host: “[m.xx.cn](http://m.xx.cn)”, referrer:  
“[http://m.xx.cn/pnp4nagios/index.php/graph?host=sxcq-web&srv=PING](http://m.xx.cn/pnp4nagios/index.php/graph?host=sxcq-web&srv=PING)”

2013/01/14 16:02:26 [error] 31310#0: \*1161676 recv() failed (104:  
Connection  
reset by peer) while reading response header from upstream, client:  
123.151.148.201, server: [www.xx.gov.cn](http://www.xx.gov.cn), request: “GET  
/plus/view.php?aid=3402 HTTP/1.1”, upstream:  
“[http://10.2.4.4:80/plus/view.php?aid=3402](http://10.2.4.4:80/plus/view.php?aid=3402)”, host: “[www.xx.gov.cn](http://www.xx.gov.cn)”

I checked backend server’s log , No erros in it …

My nginx proxy conf is:

Http’s section:  
http {  
include mime.types;  
default\_type application/octet-stream;  
sendfile on;  
tcp\_nopush on;  
tcp\_nodelay on;  
keepalive\_timeout 120;  
client\_body\_timeout 300;  
server\_tokens off;  
send\_timeout 3m;  
gzip on;  
gzip\_http\_version 1.0;  
gzip\_min\_length 1000;  
gzip\_buffers 4 8k;  
gzip\_comp\_level 6;  
gzip\_types text/plain image/gif image/jpeg image/png text/css  
application/json application/x-javascript text/xml application/xml  
application/xml+rss text/javascript;  
client\_max\_body\_size 64M;  
server {  
listen 80 default;  
server\_name \_;  
return 403;  
}  
Proxy’s section:  
upstream xx{  
server 10.2.4.11;  
}  
server {  
listen 80;  
server\_name [www.xx.cn](http://www.xx.cn);  
#charset koi8-r;  
#access\_log logs/host.access.log main;  
location / {  
root html;  
index index.html index.htm;  
proxy\_redirect off ;  
proxy\_set\_header Host $host;  
proxy\_set\_header X-Real-IP $remote\_addr;  
proxy\_set\_header X-Forwarded-For  
$proxy\_add\_x\_forwarded\_for;  
proxy\_set\_header Accept-Encoding “”;  
client\_max\_body\_size 1000m;  
proxy\_connect\_timeout 15;  
proxy\_send\_timeout 600;  
proxy\_read\_timeout 600;  
proxy\_buffer\_size 512k;  
proxy\_buffers 8 512k;  
proxy\_busy\_buffers\_size 512k;  
proxy\_temp\_file\_write\_size 512k;  
proxy\_next\_upstream error timeout invalid\_header http\_500 http\_503  
http\_404;  
proxy\_pass [http://xx](http://xx);  
include attack.conf;  
}  
location ~ .\*.(html|js|css|jpg|png|gif|flv|ico|swf)$ {  
expires max;  
root /home/nginx\_cache/www.sxcq.cn;  
proxy\_set\_header Host $host;  
proxy\_set\_header X-Real-IP $remote\_addr;  
proxy\_set\_header X-Forwarded-For  
$proxy\_add\_x\_forwarded\_for;  
proxy\_set\_header Accept-Encoding “”;  
proxy\_connect\_timeout 15;  
proxy\_send\_timeout 600;  
proxy\_read\_timeout 600;  
proxy\_buffer\_size 512k;  
proxy\_buffers 8 512k;  
proxy\_busy\_buffers\_size 512k;  
proxy\_temp\_file\_write\_size 512k;  
proxy\_store\_access user:rw group:rw all:rw;  
proxy\_temp\_path /home/nginx\_cache/www.xx.cn;  
proxy\_next\_upstream error timeout invalid\_header http\_500 http\_503  
http\_404;  
proxy\_store on;  
if ( !-e $request\_filename) {  
proxy\_pass [http://xx](http://xx);  
}

```
     }

    error_page 500 502 503 504 /50x.html;
    location = /50x.html {
        root html;
    }

}

```

Pls help me… Thanks!

Posted at Nginx Forum:

> **[The quesion will be kill me](https://forum.nginx.org/read.php?2,235031,235031#msg-235031)**
>
> Using nginx make proxy server, the backend server are nginx,apache Sometimes,the web is not ok ! An error occurred. Sorry, the page you are looking for is currently unavailable. Please try again later. If you are the system administrator of this re
