关于批量增加nginx 主机头的说明
1、登录跳板机,编辑 /data/nginx/http_domain/domain.conf 文件,按照该文件中的格式,添加新增的域名;
2、执行下面命令,将domain.conf 文件批量推送到所有的web 服务器(web 服务器的配置文件在 /etc/ansible/hosts 中)
ansible webs -m copy -a 'src=/data/nginx/http_domain/domain.conf dest=/etc/nginx/http_domain/'
3、批量检测配置是否有问题:
ansible webs -m raw -a 'nginx -t'
4、批量重新加载nginx 配置:
ansible webs -m raw -a 'sevice ngnix restaret'
签名:这个人很懒,什么也没有留下!