From 900e7cda1c8eb203069f2e067c4766dd89a1012c Mon Sep 17 00:00:00 2001 From: wulabing Date: Wed, 9 Jun 2021 10:41:55 +0800 Subject: [PATCH] Xray-1.2.10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [fix] 修复部分用户因为 ping 命令缺失导致的 IP 一致校验不通过 [fix] 修复部分用户无法自动续期证书问题(需要重新/覆盖安装) [update] 添加手动更新SSL证书选项 --- config/web.conf | 21 --------------------- config/web2.conf | 21 +++++++++++++++++++++ install.sh | 9 ++++++--- 3 files changed, 27 insertions(+), 24 deletions(-) create mode 100644 config/web2.conf diff --git a/config/web.conf b/config/web.conf index 8fa2ee1..2580508 100644 --- a/config/web.conf +++ b/config/web.conf @@ -1,25 +1,4 @@ server -{ - listen 127.0.0.1:60000 proxy_protocol; - listen 127.0.0.1:60001 http2 proxy_protocol; - server_name xxx; - index index.html index.htm index.php default.php default.htm default.html; - root /www/xray_web; - add_header Strict-Transport-Security "max-age=63072000" always; - - location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ - { - expires 30d; - error_log off; - } - - location ~ .*\.(js|css)?$ - { - expires 12h; - error_log off; - } -} -server { listen 80; listen [::]:80; diff --git a/config/web2.conf b/config/web2.conf new file mode 100644 index 0000000..2b19f88 --- /dev/null +++ b/config/web2.conf @@ -0,0 +1,21 @@ +server +{ + listen 127.0.0.1:60000 proxy_protocol; + listen 127.0.0.1:60001 http2 proxy_protocol; + server_name xxx; + index index.html index.htm index.php default.php default.htm default.html; + root /www/xray_web; + add_header Strict-Transport-Security "max-age=63072000" always; + + location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ + { + expires 30d; + error_log off; + } + + location ~ .*\.(js|css)?$ + { + expires 12h; + error_log off; + } +} diff --git a/install.sh b/install.sh index 6fb4121..01881bb 100644 --- a/install.sh +++ b/install.sh @@ -27,7 +27,7 @@ OK="${Green}[OK]${Font}" ERROR="${Red}[ERROR]${Font}" # 变量 -shell_version="1.2.9" +shell_version="1.2.10" github_branch="main" xray_conf_dir="/usr/local/etc/xray" website_dir="/www/xray_web/" @@ -303,8 +303,11 @@ function modify_tls_version() { function configure_nginx() { nginx_conf="/etc/nginx/conf.d/${domain}.conf" + nginx_conf_2="/etc/nginx/conf.d/${domain}_2.conf" cd /etc/nginx/conf.d/ && rm -f ${domain}.conf && wget -O ${domain}.conf https://raw.githubusercontent.com/wulabing/Xray_onekey/${github_branch}/config/web.conf + cd /etc/nginx/conf.d/ && rm -f ${domain}_2.conf && wget -O ${domain}_2.conf https://raw.githubusercontent.com/wulabing/Xray_onekey/${github_branch}/config/web2.conf sed -i "/server_name/c \\\tserver_name ${domain};" ${nginx_conf} + sed -i "/server_name/c \\\tserver_name ${domain};" ${nginx_conf_2} judge "Nginx config modify" systemctl restart nginx @@ -381,7 +384,7 @@ function ssl_install() { function acme() { - sed -i "27s/^/#/" "$nginx_conf" + sed -i "6s/^/#/" "$nginx_conf" # 启动 Nginx Xray 并使用 Nginx 配合 acme 进行证书签发 systemctl restart nginx @@ -400,7 +403,7 @@ function acme() { exit 1 fi - sed -i "27s/#//" "$nginx_conf" + sed -i "6s/#//" "$nginx_conf" } function ssl_judge_and_install() {