admin 发表于 2019-6-22 00:59:27

502 Bad Gateway 自动重启脚本

一个简单的脚本,用来监控502的,如果遇到502,自动重启PHP进程。适用于LNMP环境。以下文件,存放于 /root 或其它目录:#!/bin/bashMY_URL="http://www.vpsmm.com/"RESULT=`curl -I $MY_URL|grep "HTTP/1.1 502"`if [ -n "$RESULT" ]; then      /etc/init.d/php-fpm restartfi
给予可执行权限:chmod +x /root/php.sh通过 crontab 设置自动运行:crontab -e* * * * * /root/php.sh
页: [1]
查看完整版本: 502 Bad Gateway 自动重启脚本