From c8583eb6017397a9b5873f6fe0097fdc15935e60 Mon Sep 17 00:00:00 2001 From: 233boy <31657650+233boy@users.noreply.github.com> Date: Fri, 14 Oct 2022 10:00:21 +0800 Subject: [PATCH] fix #960 --- src/caddy-config.sh | 7 +++++-- src/download-caddy.sh | 2 +- v2ray.sh | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/caddy-config.sh b/src/caddy-config.sh index 77392a4..7f131a8 100644 --- a/src/caddy-config.sh +++ b/src/caddy-config.sh @@ -1,11 +1,14 @@ # local email=$(((RANDOM << 22))) # tls ${email}@gmail.com +if [[ $proxy_site ]]; then + proxy_is=$(echo $proxy_site | sed 's#/$##') +fi case $v2ray_transport in 4|33) if [[ $is_path ]]; then cat >/etc/caddy/Caddyfile <<-EOF $domain { - reverse_proxy $proxy_site { + reverse_proxy $proxy_is { header_up Host {upstream_hostport} header_up X-Forwarded-Host {host} } @@ -28,7 +31,7 @@ import sites/* if [[ $is_path ]]; then cat >/etc/caddy/Caddyfile <<-EOF $domain { - reverse_proxy $proxy_site { + reverse_proxy $proxy_is { header_up Host {upstream_hostport} header_up X-Forwarded-Host {host} } diff --git a/src/download-caddy.sh b/src/download-caddy.sh index dd20bb4..e43135b 100644 --- a/src/download-caddy.sh +++ b/src/download-caddy.sh @@ -7,7 +7,7 @@ _download_caddy_file() { fi # local caddy_download_link="https://caddyserver.com/download/linux/${caddy_arch}?license=personal" # local caddy_download_link="https://github.com/caddyserver/caddy/releases/download/v1.0.4/caddy_v1.0.4_linux_${caddy_arch}.tar.gz" - local caddy_download_link="https://github.com/caddyserver/caddy/releases/download/v2.5.1/caddy_2.5.1_linux_${caddy_arch}.tar.gz" + local caddy_download_link="https://github.com/caddyserver/caddy/releases/download/v2.6.1/caddy_2.6.2_linux_${caddy_arch}.tar.gz" mkdir -p $caddy_tmp diff --git a/v2ray.sh b/v2ray.sh index 2ea6202..c59e81d 100644 --- a/v2ray.sh +++ b/v2ray.sh @@ -10,7 +10,7 @@ none='\e[0m' # Root [[ $(id -u) != 0 ]] && echo -e " 哎呀……请使用 ${red}root ${none}用户运行 ${yellow}~(^_^) ${none}" && exit 1 -_version="v3.63" +_version="v3.64" cmd="apt-get"