咨询热线:4006-75-4006

售前:9:00-23:30    备案:9:00-18:00    技术:7*24h

Nginx 遇到502 Bad Gateway 自动重启的脚本代码

2018-01-22 23:20:28 7174次
#!/usr/bin/php 
<!--$url = 'http://www.landui.com'; 
$cmd = '/usr/local/php/sbin/php-fpm restart'; 
for($i = 0; $i < 5; $i ++){ $exec = "curl connect-timeout 3 -I $url 2>/dev/null"; 
$res = shell_exec($exec); 
if(stripos($res, '502 Bad Gateway') !== false){ 
shell_exec($cmd); 
exit(); 
} 
} 
-->



首页
最新活动
个人中心