2015年4月6日 星期一

Restart php5-fpm without stopping service

nginx + php5-fpm is a good solution for web service, but php5 have to keep updated to prevent security issue.
When php5-fpm is upgrading, it will restart php5-fpm.
php5-fpm probably takes 5 ~ 10 seconds to restart.



When php5-fpm stopped, nginx shows 500 error.
So I setup 500 error to custom 500 page in nginx.conf
-- Custom 500 page will wait and reload the page again.

custom 500.html
--
Robots will access again because 500 error looks like a common high-load error.
Browser just displayed "Loading...", then reload the page in 5 seconds.


Related: Restart mysql without stopping service