<!DOCTYPE html>
<html><head>
<meta charset="UTF-8">
</head><body><p>Hi,</p><p>I am using nginx/1.12.0 as reverse proxy with Apache/2.2.15</p><p>Relevant configuration is:</p><p><br></p><p>upstream backend {<br>ip_hash;<br> server 127.0.0.1:8080; # IP goes here.<br> }</p><p><br></p><p>server {<br> listen 2xxxxx; # IP goes here.</p><p>server_name www.somesite;</p><p># Set proxy headers for the passthrough<br> proxy_set_header Host $host;<br> proxy_set_header X-Real-IP $remote_addr;<br> proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;<br> #proxy_set_header X-Forwarded-For $remote_addr;</p><p># Let the Set-Cookie header through.<br> proxy_pass_header Set-Cookie;</p><p># Max upload size: make sure this matches the php.ini in .htaccess<br> client_max_body_size 8m;</p><p># Catch the wordpress cookies.<br> # Must be set to blank first for when they don't exist.<br> set $wordpress_auth "";<br> if ($http_cookie ~* "wordpress_logged_in_[^=]*=([^%]+)%7C") {<br> set $wordpress_auth wordpress_logged_in_$1;<br> }</p><p># Set the proxy cache key<br> set $cache_key $scheme$host$uri$is_args$args;</p><p>location ~* ^/account<br> {<br> proxy_pass http://backend;<br> expires off;<br> }<br> location ~* ^/user<br> {<br> proxy_pass http://backend;<br> expires off;<br> }<br> location ~* ^/login<br> {<br> proxy_pass http://backend;<br> expires off;<br> }</p><p><br></p><p>location / {<br> proxy_pass http://backend;<br> proxy_cache main;<br> proxy_cache_key $cache_key;<br> proxy_cache_valid 30m; # 200, 301 and 302 will be cached.<br>proxy_cache_use_stale error<br> timeout<br> invalid_header<br> http_500<br> http_502<br> http_504<br> http_404;<br> # 2 rules to dedicate the no caching rule for logged in users.<br> proxy_cache_bypass $wordpress_auth; # Do not cache the response.<br> proxy_no_cache $wordpress_auth; # Do not serve response from cache.<br>proxy_buffers 8 2m;<br> proxy_buffer_size 10m;<br> proxy_busy_buffers_size 10m;<br> }<br>}</p><p><br></p><p>for several hours main website has been reported as "down".</p><p>In fact, I noticed several messages like this in /var/log/nginx/error_log:</p><p><br></p><p>2017/06/10 01:20:21 [error] 2038#2038: *4778137 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 15yyyyyyyyyyyy, server: www.somesite.it, request: "GET /30541-2/ HTTP/1.1", upstream: "http://127.0.0.1:8080/305dd-2/", host: "www.somesite.it", referrer: "https://www.google.it/"</p><p><br></p><p>But, according to Apache logs, I have no errors at all, and I have access with "200 OK" all the time.</p><p>So, I guess, Apache still received requests from nginx.</p><p>How is it possible?</p><p>thank you very muhc </p></body></html>