U
U
unwrecker2013-05-30 10:51:29
Nginx
unwrecker, 2013-05-30 10:51:29

502 Bad Gateway during php5-fpm restart

Is there a way to make nginx wait a while while the upstream is down instead of throwing a 502 error?

This doesn't help:

    keepalive_timeout 600;
    send_timeout 600;
    proxy_send_timeout 600;
    proxy_read_timeout 600;
    fastcgi_read_timeout 600;
    proxy_connect_timeout 600;

Answer the question

In order to leave comments, you need to log in

4 answer(s)
P
Puma Thailand, 2013-05-30
@unwrecker

The easiest way is to use two php-fpm on different ports, update the code in one directory, switch nginx to another port and make it reload
. And in nginx reload works without dropping clients.
business set to 30 minutes.

E
Evengard, 2013-05-30
@Evengard

The point here is not what to wait / not to wait, but that the OS immediately gives a whack, because the socket cannot connect - the php-fpm port has not yet been bound. So in general, except for perversions with error_page, I'm afraid not

M
max_mara, 2013-05-30
@max_mara

Alternatively, you can set a custom error_page, which will be automatically updated after some time.

G
gaelpa, 2013-05-30
@gaelpa

Is reload (SIGUSR2) not enough in your case?
>> graceful reload of all workers + reload of fpm conf/binary

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question