fix nginx shell script for sub
This commit is contained in:
parent
db7fa7a2a0
commit
fa1bf9e73c
14
sub/start.sh
14
sub/start.sh
|
@ -17,15 +17,21 @@ fi
|
||||||
|
|
||||||
nohup /base/subconverter & echo "启动成功"
|
nohup /base/subconverter & echo "启动成功"
|
||||||
|
|
||||||
sed -i '$d' /etc/nginx/conf.d/default.conf
|
init_nginx (){
|
||||||
sed -i '$d' /etc/nginx/conf.d/default.conf
|
sed -i '$d' /etc/nginx/conf.d/default.conf
|
||||||
sed -i '$d' /etc/nginx/conf.d/default.conf
|
sed -i '$d' /etc/nginx/conf.d/default.conf
|
||||||
cat >> /etc/nginx/conf.d/default.conf <<EOF
|
sed -i '$d' /etc/nginx/conf.d/default.conf
|
||||||
|
cat >> /etc/nginx/conf.d/default.conf <<EOF
|
||||||
location ~* /(sub|render|getruleset|surge2clash|getprofile) {
|
location ~* /(sub|render|getruleset|surge2clash|getprofile) {
|
||||||
proxy_redirect off;
|
proxy_redirect off;
|
||||||
proxy_pass http://127.0.0.1:25500;
|
proxy_pass http://127.0.0.1:25500;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
|
if [[ ! $(cat /etc/nginx/conf.d/default.conf | grep 25500) ]]; then
|
||||||
|
init_nginx
|
||||||
|
fi
|
||||||
|
|
||||||
nginx -g "daemon off;"
|
nginx -g "daemon off;"
|
||||||
|
|
Loading…
Reference in New Issue