shell脚本-nginx负载tomcat

[root@VM_0_5_centos shell]# cat nginx.sh
#!/bin/bash
yum -y install gcc pcre-devel zlib-devel
wget http://nginx.org/download/nginx-1.17.10.tar.gz
tar zxf nginx-1.17.10.tar.gz
cd nginx-1.17.10/
./configure && make && make install
sed -i '/#gzip/a    upstream webs{' /usr/local/nginx/conf/nginx.conf
sed -i '/upstream webs{/a server 10.0.0.43:8080; ' /usr/local/nginx/conf/nginx.conf
sed -i '/server 10.0.0.43:8080;/a }' /usr/local/nginx/conf/nginx.conf
sed -i '48s/index  index.html index.htm;/index  index.html index.jsp index.htm;/' /usr/local/nginx/conf/nginx.conf
sed -i '/index  index.html index.jsp index.htm;/a proxy_pass http://webs;' /usr/local/nginx/conf/nginx.conf
/usr/local/nginx/sbin/nginx
原创文章 96 获赞 4 访问量 2186

猜你喜欢

转载自blog.csdn.net/weixin_46380571/article/details/105703959