# Keepalive\_timeout, proxy\_send\_timeout, and proxy\_read\_timeout ignored

**URL:** <https://www.ruby-forum.com/t/keepalive-timeout-proxy-send-timeout-and-proxy-read-timeout-ignored/242662>\
**Category:** NGINX\
**Created:** [July 13, 2015, 7:41pm UTC](https://www.ruby-forum.com/t/keepalive-timeout-proxy-send-timeout-and-proxy-read-timeout-ignored/242662 "2015-07-13T19:41:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![musicdenotation](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ea666f/32.png) [@musicdenotation](https://www.ruby-forum.com/u/musicdenotation)\
**Post date:** [July 13, 2015, 7:41pm UTC](https://www.ruby-forum.com/t/keepalive-timeout-proxy-send-timeout-and-proxy-read-timeout-ignored/242662/1 "2015-07-13T19:41:10Z")

</div>

Hi, I’m using AWS Beanstalk with nginx in front of a Puma server serving  
Ruby on Rails. I have one URL that is for an EventSource so it is kept  
alive  
and data is streamed out. I was running into this problem  
[Dropped https client connection doesn't drop backend proxy\_pass connection](http://forum.nginx.org/read.php?2,237386,237386) where when the client  
closes  
the browser but nginx keeps the connection alive forever so I tried  
having  
nginx automatically close the connection after 5 seconds. I set  
keepalive\_timeout, proxy\_send\_timeout, and proxy\_read\_timeout all to 5  
seconds but all were ignored. The connection remained open until nginx  
was  
restarted.

# nginx config

upstream my\_app {  
server unix:///var/run/puma/my\_app.sock;  
}

server {  
listen 80;  
server\_name \_ localhost; # need to listen to localhost for worker tier

if ($http\_x\_forwarded\_proto = “http”) { return 301  
https://$host$request\_uri; }

location /dashboard\_stream {  
proxy\_pass http://my\_app; # match the name of upstream directive  
which  
is defined above  
proxy\_set\_header Host $host;  
proxy\_set\_header X-Forwarded-For $proxy\_add\_x\_forwarded\_for;  
proxy\_buffering off;  
proxy\_cache off;  
proxy\_http\_version 1.1;  
proxy\_set\_header Connection ‘’;  
chunked\_transfer\_encoding off;  
keepalive\_timeout 5s;  
proxy\_send\_timeout 5s;  
proxy\_read\_timeout 5s;  
}  
}

# nginx version

nginx version: nginx/1.6.2

# AWS linux version

NAME=“Amazon Linux AMI”  
VERSION=“2015.03”  
ID=“amzn”  
ID\_LIKE=“rhel fedora”  
VERSION\_ID=“2015.03”  
PRETTY\_NAME=“Amazon Linux AMI 2015.03”  
ANSI\_COLOR=“0;33”  
CPE\_NAME=“cpe:/o:amazon:linux:2015.03:ga”  
HOME\_URL=“[AWS | Amazon Linux AMI](http://aws.amazon.com/amazon-linux-ami/)”  
Amazon Linux AMI release 2015.03

# kernel version

Linux ip-172-31-12-138 3.14.42-31.38.amzn1.x86\_64 #1 SMP Wed May 13  
20:33:05  
UTC 2015 x86\_64 x86\_64 x86\_64 GNU/Linux

Posted at Nginx Forum:

> **[keepalive\_timeout, proxy\_send\_timeout, and proxy\_read\_timeout ignored](https://forum.nginx.org/read.php?2,260257,260257#msg-260257)**
>
> Hi, I'm using AWS Beanstalk with nginx in front of a Puma server serving Ruby on Rails. I have one URL that is for an EventSource so it is kept alive and data is streamed out. I was running into this problem...

---

<div class="post-metadata">

**Author:** ![dgobaud](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/9e8a1a/32.png) [@dgobaud](https://www.ruby-forum.com/u/dgobaud)\
**Post date:** [July 14, 2015, 5:14am UTC](https://www.ruby-forum.com/t/keepalive-timeout-proxy-send-timeout-and-proxy-read-timeout-ignored/242662/2 "2015-07-14T05:14:56Z")

</div>

In modern times, with all the marketplace increasing countless design  
renovations, wrist watches can be around appropriate downloads on the  
genuine. How come primarily near, it’s possible to think about.  
Considering that entire concept of watches would be to create a  
reasonably priced products, a solution which can be appreciated through  
just about all see fanciers, not only through the loaded handful of.  
Thinking that signifies that gold and silver coins which include jewelry  
or possibly platinum eagle are superceded by using the highest quality  
chrome steel. Other than in which, all kinds of things through  
manufactured along with the greatest attention, in order to make each  
individual start looking, believe and additionally deliver the results  
enjoy it has the real comparable version. The simple truth is lots of  
webpages merchandising looks after since they are promoting very well.  
The reason might these distribute which means that nicely in the event  
top quality has been a major problem? Precisely why would most likely  
individuals continuously revisit get a great deal more any time  
displeased with each other? The challenge in fact is which should you  
not may well decline a few fantastic thousand $ $ $ $, or perhaps tons  
of for an addition, wristwatches would be the perfect substitute for you  
personally. Together with actually, regardless if My partner and i which  
usually sort of income to shell out, I had created get unlikely to try  
it again. Exactly why invest 12 or maybe hundred dollars days more about  
something which is definitely plainly cost-effective? An existing close  
friend of excavation as a result of secondary education just got their  
self a watch, given that exactly what greater observe comes improved  
with other individuals? Sure, my super cool buddy Charles is rather  
successful. She appeared to be boasting very much together with his  
cutting edge order, on the subject of the point that it will be a real  
confined element etc ., that we thought i would model your ex boyfriend  
in addition to When i dictated a watch intended for by myself, since i  
won’t be able to afford the first.  
[http://www.attrinity.com](http://www.attrinity.com)  
[http://www.watchesbuy.co.uk](http://www.watchesbuy.co.uk)  
[http://www.waxwatchreplicas.co.uk](http://www.waxwatchreplicas.co.uk)
