# Timeout issues

**URL:** <https://www.ruby-forum.com/t/timeout-issues/212043>\
**Category:** NGINX\
**Created:** [September 20, 2011, 7:33pm UTC](https://www.ruby-forum.com/t/timeout-issues/212043 "2011-09-20T19:33:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [September 20, 2011, 7:33pm UTC](https://www.ruby-forum.com/t/timeout-issues/212043/1 "2011-09-20T19:33:43Z")

</div>

Hi All,

Ok I am having issues with NGINX and it timing out. My scenario is that  
I am  
using NGINX as a web server front end for my application. I have two  
folder  
being served as aliass for static content and one location doing a  
proxy\_pass to a java server.

My issue is that on one of the request that goes through the proxy\_pass  
to  
the local java web server will time out through nginx within 10 minutes.  
The  
timeout is a browser timeout. It takes 11-12 minutes to load the page  
without nginx, so I need nginx to not kill the session until that time  
has  
passed. I have tried every timeout setting imaginable that I could find  
and  
I still get a browser timeout at 10 minutes. Note this is an SSL  
connection,  
the test without nginx in the way was also an SSL connection.

Below are my configs, note all the timeout options have been slowly  
added  
over time and lots of testing…they are not my wanted scenario but I  
am  
trying to figure out how this is done.

NGINX.conf

user www-data;  
worker\_processes 4;

error\_log /var/log/nginx/error.log;  
pid /var/run/nginx.pid;

events {  
worker\_connections 1024;  
# multi\_accept on;  
}

http {  
include /etc/nginx/mime.types;

```
access_log /var/log/nginx/access.log;

sendfile on;
#tcp_nopush on;

#keepalive_timeout 0;
keepalive_timeout 900 900;

```

client\_body\_timeout 900;  
client\_header\_timeout 900;  
send\_timeout 900;

```
tcp_nodelay on;

gzip on;
gzip_disable "MSIE [1-6]\.(?!.*SV1)";
gzip_types text/plain text/html text/css text/javascript image/png

```

image/x-icon application/x-javascript application/xml image/gif;

```
ssl_session_cache shared:SSL:100k;
ssl_session_timeout 20m;

include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;

```

}

Site Conf

server {  
listen 80;  
server\_name localhost;

```
    #charset koi8-r;

    access_log /var/log/nginx/80-app.access.log;
    error_log /var/log/nginx/80-app.error.log;

    location / {
        rewrite ^/(.*)$ https://$host/$1 redirect;
    }

    error_page 404 /404.html;

    # redirect server error pages to the static page /50x.html
    #
    error_page 500 502 503 504 /50x.html;
    location = /50x.html {
        root html;
    }

```

}  
server {  
listen 443;  
server\_name localhost;

```
    access_log /var/log/nginx/app.access.log;
    error_log /var/log/nginx/app.error.log;

    ssl on;
    ssl_certificate /usr/local/oc/install/server.com.crt;
    ssl_certificate_key /usr/local/oc/install/server.key;

```

# fail\_timeout 3600s;

```
keepalive_timeout 900 900;

```

client\_body\_timeout 900;  
client\_header\_timeout 900;  
send\_timeout 900;  
# directly serve the static files in the `images` directory  
location ~ ^/APP/includes/(.\*)$ {  
# add future expiry date to force caching of the file on the  
client  
expires max;  
add\_header Cache-Control “public”;  
alias /usr/local/tomcat/webapps/APP/includes/$1;  
}

```
    location ~ ^/APP/images/(.*)$ {
        # add future expiry date to force caching of the file on the

```

client  
expires max;  
add\_header Cache-Control “public”;  
alias /usr/local/tomcat/webapps/APP/images/$1;  
}  
# pass all other requests to Tomcat  
location /APP {  
proxy\_read\_timeout 3600s;  
proxy\_connect\_timeout 3600s;  
proxy\_send\_timeout 3600s;

```
        proxy_pass http://127.0.0.1:8080/APP;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }

```

}

Any help is greatly appreciated. I wouldnt even mind if it is possible  
to  
disable timeout all together just as a test.

Thanks,  
Shaun

---

<div class="post-metadata">

**Author:** ![Shaun\_Martin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/3e96dc/32.png) [@Shaun\_Martin](https://www.ruby-forum.com/u/Shaun_Martin)\
**Post date:** [September 20, 2011, 8:54pm UTC](https://www.ruby-forum.com/t/timeout-issues/212043/2 "2011-09-20T20:54:47Z")

</div>

Hi All,

Oh yah I forgot to mention there are no entries in the error log saying  
anything about connection timed out.

Thanks,  
Shaun
