mirror of https://github.com/mack-a/v2ray-agent
feat(脚本): 优化nginx不同版本配置
parent
539e9bbfc0
commit
1e94d39a2b
19
install.sh
19
install.sh
|
@ -1231,6 +1231,10 @@ updateRedirectNginxConf() {
|
||||||
nginxH2Conf="listen 127.0.0.1:31302 http2 so_keepalive=on;"
|
nginxH2Conf="listen 127.0.0.1:31302 http2 so_keepalive=on;"
|
||||||
nginxVersion=$(nginx -v 2>&1)
|
nginxVersion=$(nginx -v 2>&1)
|
||||||
|
|
||||||
|
if echo "${nginxVersion}" | grep -q "1.25"; then
|
||||||
|
nginxH2Conf="listen 127.0.0.1:31302 so_keepalive=on;http2 on;"
|
||||||
|
fi
|
||||||
|
|
||||||
cat <<EOF >${nginxConfigPath}alone.conf
|
cat <<EOF >${nginxConfigPath}alone.conf
|
||||||
server {
|
server {
|
||||||
listen 127.0.0.1:31300;
|
listen 127.0.0.1:31300;
|
||||||
|
@ -1241,9 +1245,6 @@ EOF
|
||||||
|
|
||||||
if echo "${selectCustomInstallType}" | grep -q 2 && echo "${selectCustomInstallType}" | grep -q 5 || [[ -z "${selectCustomInstallType}" ]]; then
|
if echo "${selectCustomInstallType}" | grep -q 2 && echo "${selectCustomInstallType}" | grep -q 5 || [[ -z "${selectCustomInstallType}" ]]; then
|
||||||
|
|
||||||
if echo "${nginxVersion}" | grep -q "1.25"; then
|
|
||||||
nginxH2Conf="listen 127.0.0.1:31302 so_keepalive=on;http2 on;"
|
|
||||||
fi
|
|
||||||
cat <<EOF >>${nginxConfigPath}alone.conf
|
cat <<EOF >>${nginxConfigPath}alone.conf
|
||||||
server {
|
server {
|
||||||
${nginxH2Conf}
|
${nginxH2Conf}
|
||||||
|
@ -1284,9 +1285,6 @@ server {
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
elif echo "${selectCustomInstallType}" | grep -q 5 || [[ -z "${selectCustomInstallType}" ]]; then
|
elif echo "${selectCustomInstallType}" | grep -q 5 || [[ -z "${selectCustomInstallType}" ]]; then
|
||||||
if echo "${nginxVersion}" | grep -q "1.25"; then
|
|
||||||
nginxH2Conf="listen 127.0.0.1:31302 so_keepalive=on;http2 on;"
|
|
||||||
fi
|
|
||||||
cat <<EOF >>${nginxConfigPath}alone.conf
|
cat <<EOF >>${nginxConfigPath}alone.conf
|
||||||
server {
|
server {
|
||||||
${nginxH2Conf}
|
${nginxH2Conf}
|
||||||
|
@ -1298,7 +1296,6 @@ server {
|
||||||
}
|
}
|
||||||
location /${currentPath}grpc {
|
location /${currentPath}grpc {
|
||||||
client_max_body_size 0;
|
client_max_body_size 0;
|
||||||
# keepalive_time 1071906480m;
|
|
||||||
keepalive_requests 4294967296;
|
keepalive_requests 4294967296;
|
||||||
client_body_timeout 1071906480m;
|
client_body_timeout 1071906480m;
|
||||||
send_timeout 1071906480m;
|
send_timeout 1071906480m;
|
||||||
|
@ -1311,9 +1308,6 @@ server {
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
elif echo "${selectCustomInstallType}" | grep -q 2 || [[ -z "${selectCustomInstallType}" ]]; then
|
elif echo "${selectCustomInstallType}" | grep -q 2 || [[ -z "${selectCustomInstallType}" ]]; then
|
||||||
if echo "${nginxVersion}" | grep -q "1.25"; then
|
|
||||||
nginxH2Conf="listen 127.0.0.1:31302 so_keepalive=on;http2 on;"
|
|
||||||
fi
|
|
||||||
cat <<EOF >>${nginxConfigPath}alone.conf
|
cat <<EOF >>${nginxConfigPath}alone.conf
|
||||||
server {
|
server {
|
||||||
${nginxH2Conf}
|
${nginxH2Conf}
|
||||||
|
@ -1337,9 +1331,6 @@ server {
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
else
|
else
|
||||||
if echo "${nginxVersion}" | grep -q "1.25"; then
|
|
||||||
nginxH2Conf="listen 127.0.0.1:31302 so_keepalive=on;http2 on;"
|
|
||||||
fi
|
|
||||||
|
|
||||||
cat <<EOF >>${nginxConfigPath}alone.conf
|
cat <<EOF >>${nginxConfigPath}alone.conf
|
||||||
server {
|
server {
|
||||||
|
@ -8462,7 +8453,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.11.20"
|
echoContent green "当前版本:v2.11.21"
|
||||||
echoContent green "Github:https://github.com/mack-a/v2ray-agent"
|
echoContent green "Github:https://github.com/mack-a/v2ray-agent"
|
||||||
echoContent green "描述:八合一共存脚本\c"
|
echoContent green "描述:八合一共存脚本\c"
|
||||||
showInstallStatus
|
showInstallStatus
|
||||||
|
|
Loading…
Reference in New Issue