# Timeout Issues

**URL:** <https://www.ruby-forum.com/t/timeout-issues/212125>\
**Category:** NGINX\
**Created:** [September 22, 2011, 5:49pm UTC](https://www.ruby-forum.com/t/timeout-issues/212125 "2011-09-22T17:49:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [September 22, 2011, 5:49pm UTC](https://www.ruby-forum.com/t/timeout-issues/212125/1 "2011-09-22T17:49:34Z")

</div>

Hi All,

I submitted this originally through the lists but I noticed it did not  
create a topic here for it. So I am adding it as a topic, I hope this  
acceptable.

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 alias’s 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 wouldn’t even mind if it is  
possible to disable timeout all together just as a test.

Thanks,  
Shaun

Posted at Nginx Forum:

> **[Timeout Issues](https://forum.nginx.org/read.php?2,215628,215628#msg-215628)**
>
> Hi All, I submitted this originally through the lists but I noticed it did not create a topic here for it. So I am adding it as a topic, I hope this acceptable. Hi All, Ok I am having issues with NGINX and it timing out. My scenario is that I am...

---

<div class="post-metadata">

**Author:** ![openclinica](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/34f0e0/32.png) [@openclinica](https://www.ruby-forum.com/u/openclinica)\
**Post date:** [March 9, 2012, 2:02am UTC](https://www.ruby-forum.com/t/timeout-issues/212125/2 "2012-03-09T02:02:27Z")

</div>

Hi, Shaun. Did you ever find a solution to this? I’m having the same 10  
minute issue and I’ve tried every timeout setting nginx has; e.g.:

```
send_timeout 30m;
proxy_read_timeout 30m;
proxy_connect_timeout 30m;
client_header_timeout 30m;
client_body_timeout 30m;

```

Posted at Nginx Forum:

> **[Re: Timeout Issues](https://forum.nginx.org/read.php?2,215628,223654#msg-223654)**
>
> Hi All, I submitted this originally through the lists but I noticed it did not create a topic here for it. So I am adding it as a topic, I hope this acceptable. Hi All, Ok I am having issues with NGINX and it timing out. My scenario is that I am...

---

<div class="post-metadata">

**Author:** ![openclinica](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/34f0e0/32.png) [@openclinica](https://www.ruby-forum.com/u/openclinica)\
**Post date:** [March 9, 2012, 2:09am UTC](https://www.ruby-forum.com/t/timeout-issues/212125/3 "2012-03-09T02:09:57Z")

</div>

No I did not find any setting that would accomodate a request over 10  
minutes. I tried every setting imaginable with ever method of displaying  
time available and I have not found any solution.

Posted at Nginx Forum:

> **[Re: Timeout Issues](https://forum.nginx.org/read.php?2,215628,223655#msg-223655)**
>
> Hi All, I submitted this originally through the lists but I noticed it did not create a topic here for it. So I am adding it as a topic, I hope this acceptable. Hi All, Ok I am having issues with NGINX and it timing out. My scenario is that I am...
