fix nginx shell script for sub

This commit is contained in:
Stille 2022-08-23 09:57:39 +08:00
parent db7fa7a2a0
commit fa1bf9e73c
1 changed files with 10 additions and 4 deletions

View File

@ -17,15 +17,21 @@ fi
nohup /base/subconverter & echo "启动成功"
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
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
cat >> /etc/nginx/conf.d/default.conf <<EOF
location ~* /(sub|render|getruleset|surge2clash|getprofile) {
proxy_redirect off;
proxy_pass http://127.0.0.1:25500;
}
}
EOF
}
if [[ ! $(cat /etc/nginx/conf.d/default.conf | grep 25500) ]]; then
init_nginx
fi
nginx -g "daemon off;"