练习2:编写自动部署脚本
安装脚本的写法就很简单了,难点应该是在修改配置文件
[root@www tmp]# msg='upstream { server 1.1.1.1;server 2.2.2.2;server 3.3.3.3}'
[root@www tmp]# sed -ri "/^http/a $msg" nginx.conf #增加upstream
[root@www tmp]# sed -ri "/^ *location \/ \{$/a proxy_pass http://my_upstream\;" nginx.conf #修改localtion
I can feel you forgetting me。。
有一种默契叫做我不理你,你就不理我

浙公网安备 33010602011771号