美文网首页
nginx 无感发布

nginx 无感发布

作者: 乘以零 | 来源:发表于2023-04-13 11:03 被阅读0次
#!/bin/bash
IpPort=$1
ConfFile=$2
echo "$IpPort $ConfFile then sed"
sed -i s/#server\ "$IpPort"/server\ $IpPort/g "/usr/local/openresty/nginx/conf/conf.d/$ConfFile"
echo "sed success then reload nginx"
/usr/local/openresty/nginx/sbin/nginx -t
if [ $? != 0 ]; then  
    echo "[start] Error, Nginx conf file test error!!!!!!"
    exit 1
fi
/usr/local/openresty/nginx/sbin/nginx -s reload
echo "reload nginx success"


sh /home/yiwu/autodeploy/replace_ngx_us.sh 172.16.126.156:8080 app.conf

sshpass -p 'yourpassword' ssh root@10.6.30.138 sh /home/yiwu/autodeploy/recove_ngx_us.sh 172.16.126.156:8080 app.conf


相关文章

网友评论

      本文标题:nginx 无感发布

      本文链接:https://www.haomeiwen.com/subject/aoyaddtx.html