Connection timeout

absolutely_free at libero.it absolutely_free at libero.it
Wed Jun 14 18:55:27 UTC 2017


Hi,

I am using nginx/1.12.0 as reverse proxy with Apache/2.2.15

Relevant configuration is:


upstream backend {
ip_hash;
server 127.0.0.1:8080; # IP goes here.
}


server {
listen 2xxxxx; # IP goes here.

server_name www.somesite;

# Set proxy headers for the passthrough
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 X-Forwarded-For $remote_addr;

# Let the Set-Cookie header through.
proxy_pass_header Set-Cookie;

# Max upload size: make sure this matches the php.ini in .htaccess
client_max_body_size 8m;

# Catch the wordpress cookies.
# Must be set to blank first for when they don't exist.
set $wordpress_auth "";
if ($http_cookie ~* "wordpress_logged_in_[^=]*=([^%]+)%7C") {
set $wordpress_auth wordpress_logged_in_$1;
}

# Set the proxy cache key
set $cache_key $scheme$host$uri$is_args$args;

location ~* ^/account
{
proxy_pass http://backend;
expires off;
}
location ~* ^/user
{
proxy_pass http://backend;
expires off;
}
location ~* ^/login
{
proxy_pass http://backend;
expires off;
}


location / {
proxy_pass http://backend;
proxy_cache main;
proxy_cache_key $cache_key;
proxy_cache_valid 30m; # 200, 301 and 302 will be cached.
proxy_cache_use_stale error
timeout
invalid_header
http_500
http_502
http_504
http_404;
# 2 rules to dedicate the no caching rule for logged in users.
proxy_cache_bypass $wordpress_auth; # Do not cache the response.
proxy_no_cache $wordpress_auth; # Do not serve response from cache.
proxy_buffers 8 2m;
proxy_buffer_size 10m;
proxy_busy_buffers_size 10m;
}
}


for several hours main website has been reported as "down".

In fact, I noticed several messages like this in /var/log/nginx/error_log:


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/"


But, according to Apache logs, I have no errors at all, and I have access with "200 OK" all the time.

So, I guess, Apache still received requests from nginx.

How is it possible?

thank you very muhc 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20170614/6ddf4a02/attachment.html>


More information about the nginx mailing list