#!/bin/bash
if [[ `curl -sS --connect-timeout 15 -m 15 127.0.0.1/phpfpm_56_status|grep 502` == *"502"* ]]; then
/etc/init.d/php-fpm-56 stop
/etc/init.d/php-fpm-56 start
else
echo php56 normal.
fi
]]> location ~ [^/]\.php(/|$)
{
# 默认调用PHP7.2
try_files $uri =404;
fastcgi_pass unix:/tmp/php-cgi-72.sock;
fastcgi_index index.php;
include fastcgi.conf;
include pathinfo.conf;
# 当url中包含/qy_wmdc/则调用5.6版本
if ($request_uri ~* "/qy_wmdc/"){
fastcgi_pass unix:/tmp/php-cgi-56.sock;
}
}
]]>