hide/strip set cookies on static files and howto use alias

Francis Daly francis at daoine.org
Fri Apr 8 21:13:39 UTC 2016

On Fri, Apr 08, 2016 at 05:06:19AM -0400, JoakimR wrote:

Hi there,

> Hi Francis Daly thank you very much for your reply

You're welcome.

> Let's brake this down one by one. I followed you suggestion and added
> fastcgi_connect_timeout 600s; to the conf, however the pages still time out
> after ~75 sec as expected do to this

You may want to read the previous mail again. I'm pretty sure I did not
mention fastcgi_connect_timeout.

> 2016/04/06 12:30:47 [error] 9286#9286: *348669 upstream timed out (110:
> Connection timed out) while reading response header from upstream, client:
>, server: myvid.top, request: "GET ", upstream:
> "fastcgi://unix:/var/run/php-fpm.sock", host: "myvid.top"

You have nginx as the client, talking to your fastcgi(php) server. This
log file suggests that the fastcgi server is not writing to nginx
quickly enough.

The default nginx timeout is (I think) 60 seconds between reads. That
is usually suitable for fastcgi responses.

If your fastcgi server should be able to respond within that time, then
the problem you must address is why your fastcgi server is slower than
it should be.

If your fastcgi server is one of the few that has good reason to respond
more slowly than the nginx default timeout, then you must learn from
your fastcgi server how long it will take before it responds (at least,
for these requests); and then configure nginx to be willing to wait that
long (for these responses).

Nothing on the nginx side will determine how long it takes your fastcgi
server to respond. You must know how long that is; and configure your
nginx appropriately.

(If your php script starts with "sleep(100)", for example, it will
probably take it at least that long to write something. If it needs to
do that sleep, then you need to configure the client to be willing to
wait that long.)

Francis Daly        francis at daoine.org

More information about the nginx mailing list