feat(脚本): 修改域名通过cloudflare恶意解析可访问网站的问题

pull/534/merge
mack-a 2021-05-06 16:32:24 +08:00
parent bff1300ed5
commit f592dcd4e1
1 changed files with 21 additions and 16 deletions

View File

@ -551,24 +551,29 @@ updateRedirectNginxConf() {
# shellcheck disable=SC2154 # shellcheck disable=SC2154
return 301 https://${domain}$request_uri; return 301 https://${domain}$request_uri;
} }
server {
listen 31300;
server_name _;
return 403;
}
EOF EOF
if [[ "${debianVersion}" == "8" ]]; then if [[ "${debianVersion}" == "8" ]]; then
cat <<EOF >>/etc/nginx/conf.d/alone.conf cat <<EOF >>/etc/nginx/conf.d/alone.conf
server { server {
listen 31300; listen 31300;
server_name ${domain}; server_name ${domain};
root /usr/share/nginx/html; root /usr/share/nginx/html;
location /s/ { location /s/ {
add_header Content-Type text/plain; add_header Content-Type text/plain;
alias /etc/v2ray-agent/subscribe/; alias /etc/v2ray-agent/subscribe/;
} }
# 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 ~ /.well-known {allow all;}
# location /test {return 200 'fjkvymb6len';} # location /test {return 200 'fjkvymb6len';}
} }
EOF EOF
else else
cat <<EOF >>/etc/nginx/conf.d/alone.conf cat <<EOF >>/etc/nginx/conf.d/alone.conf
@ -583,8 +588,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 ~ /.well-known {allow all;}
# location /test {return 200 'fjkvymb6len';} # location /test {return 200 'fjkvymb6len';}
} }
EOF EOF
fi fi
@ -3748,7 +3753,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.19" echoContent green "当前版本v2.4.20"
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