feat(脚本): 修改首次安装是无法安装gRPC的bug

pull/534/merge
mack-a 2021-05-07 17:27:06 +08:00
parent 899dc1cfb0
commit 947c463758
1 changed files with 24 additions and 45 deletions

View File

@ -549,8 +549,8 @@ EOF
sudo yum-config-manager --enable nginx-mainline sudo yum-config-manager --enable nginx-mainline
fi fi
${installType} nginx >/dev/null 2>&1 ${installType} nginx >/dev/null 2>&1
systemctl daemon-reload >/dev/null 2>&1 systemctl daemon-reload
systemctl enable nginx >/dev/null 2>&1 systemctl enable nginx
} }
# 初始化Nginx申请证书配置 # 初始化Nginx申请证书配置
@ -617,39 +617,21 @@ updateRedirectNginxConf() {
return 403; return 403;
} }
EOF EOF
if [[ "${coreInstallType}" == "1" ]] && [[ -n $(echo ${selectCustomInstallType} | grep 5) || -z "${selectCustomInstallType}" ]]; then if [[ "${selectCoreType}" == "1" ]] && [[ -n $(echo ${selectCustomInstallType} | grep 5) || -z ${selectCustomInstallType} ]]; then
cat <<EOF >>/etc/nginx/conf.d/alone.conf cat <<EOF >>/etc/nginx/conf.d/alone.conf
server { server {
listen 31302 http2; listen 31302 http2;
server_name ${domain}; server_name ${domain};
root /usr/share/nginx/html; root /usr/share/nginx/html;
location /${currentPath}grpc { location /${currentPath}grpc {
grpc_pass grpc://127.0.0.1:31301; grpc_pass grpc://127.0.0.1:31301;
} }
} }
EOF EOF
fi fi
if [[ "${debianVersion}" == "8" ]]; then
cat <<EOF >>/etc/nginx/conf.d/alone.conf cat <<EOF >>/etc/nginx/conf.d/alone.conf
server { server {
listen 31300;
server_name ${domain};
root /usr/share/nginx/html;
location /s/ {
add_header Content-Type text/plain;
alias /etc/v2ray-agent/subscribe/;
}
# location / {
# add_header Strict-Transport-Security "max-age=63072000" always;
# }
# location ~ /.well-known {allow all;}
# location /test {return 200 'fjkvymb6len';}
}
EOF
else
cat <<EOF >>/etc/nginx/conf.d/alone.conf
server {
listen 31300; listen 31300;
server_name ${domain}; server_name ${domain};
root /usr/share/nginx/html; root /usr/share/nginx/html;
@ -660,11 +642,8 @@ EOF
location / { location / {
add_header Strict-Transport-Security "max-age=63072000" always; add_header Strict-Transport-Security "max-age=63072000" always;
} }
# location ~ /.well-known {allow all;} }
# location /test {return 200 'fjkvymb6len';}
}
EOF EOF
fi
} }
@ -3823,7 +3802,7 @@ menu() {
cd "$HOME" || exit cd "$HOME" || exit
echoContent red "\n==============================================================" echoContent red "\n=============================================================="
echoContent green "作者mack-a" echoContent green "作者mack-a"
echoContent green "当前版本v2.4.22" echoContent green "当前版本v2.4.23"
echoContent green "Githubhttps://github.com/mack-a/v2ray-agent" echoContent green "Githubhttps://github.com/mack-a/v2ray-agent"
echoContent green "描述:八合一共存脚本\c" echoContent green "描述:八合一共存脚本\c"
showInstallStatus showInstallStatus