首页 > 其他 > 详细

nginx匹配规则脚本

时间:2020-11-19 16:48:49      阅读:28      评论:0      收藏:0      [点我收藏+]

这个是可乐在工作时候用到的脚本

嘻嘻 ~

有点low哈哈哈 ~

不许喷me~

会哭的  呜呜~

 

vim  maching_nginx.sh

#!/bin/bash
#名字
name=znxd_cqjyxt_ah_bb
#portal路径
echo "#产权交易系统" > /etc/nginx/conf.d/${name}.conf
echo "#portal" >> /etc/nginx/conf.d/${name}.conf
echo "server{" >> /etc/nginx/conf.d/${name}.conf
echo -e "\t listen 1001;" >> /etc/nginx/conf.d/${name}.conf
echo -e "\t server_name 10.150.10.30;" >> /etc/nginx/conf.d/${name}.conf
echo "location /{" >> /etc/nginx/conf.d/${name}.conf
echo -e "\t root /data/static_project/znxd_cqjyxt_ah_bb/portal/dist;" >> /etc/nginx/conf.d/${name}.conf
echo -e "\t index index.html index.htm;" >> /etc/nginx/conf.d/${name}.conf
echo -e "\t }" >> /etc/nginx/conf.d/${name}.conf
echo "location /api{" >> /etc/nginx/conf.d/${name}.conf
echo -e "\t include ./conf.d/api_include.config;" >> /etc/nginx/conf.d/${name}.conf
echo -e "\tproxy_pass http://10.150.10.30:10001;" >> /etc/nginx/conf.d/${name}.conf
echo -e "\t }" >> /etc/nginx/conf.d/${name}.conf
echo "location /upload{" >> /etc/nginx/conf.d/${name}.conf
echo -e "\t root /data/docker_script/znxd_cqjyxt_ah_bb;" >> /etc/nginx/conf.d/${name}.conf
echo -e "\t }" >> /etc/nginx/conf.d/${name}.conf
echo "}" >> /etc/nginx/conf.d/${name}.conf

#admin路径
echo "#admin" >> /etc/nginx/conf.d/${name}.conf
echo "server{" >> /etc/nginx/conf.d/${name}.conf
echo -e "\t listen 1002;" >> /etc/nginx/conf.d/${name}.conf
echo -e "\t server_name 10.150.10.30;" >> /etc/nginx/conf.d/${name}.conf
echo "location /{" >> /etc/nginx/conf.d/${name}.conf
echo -e "\t root /data/static_project/znxd_cqjyxt_ah_bb/admin/dist;" >> /etc/nginx/conf.d/${name}.conf
echo -e "\t index index.html index.htm;" >> /etc/nginx/conf.d/${name}.conf
echo -e "\t }" >> /etc/nginx/conf.d/${name}.conf
echo "location /api{" >> /etc/nginx/conf.d/${name}.conf
echo -e "\t include ./conf.d/api_include.config;" >> /etc/nginx/conf.d/${name}.conf
echo -e "\t proxy_pass http://10.150.10.30:10001;" >> /etc/nginx/conf.d/${name}.conf
echo -e "\t }" >> /etc/nginx/conf.d/${name}.conf
echo "location /upload{" >> /etc/nginx/conf.d/${name}.conf
echo -e "\t root /data/docker_script/znxd_cqjyxt_ah_bb;" >> /etc/nginx/conf.d/${name}.conf
echo -e "\t }" >> /etc/nginx/conf.d/${name}.conf
echo "}" >> /etc/nginx/conf.d/${name}.conf

bash maching_nginx.sh

因为你
我愿意成为一个更好的人
不想成为你的包袱
因此发奋努力
只是为了想要证明我足以与你相配

nginx匹配规则脚本

原文:https://www.cnblogs.com/lovesmk8/p/14005979.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!