Skip to content

Commit

Permalink
feat(脚本): 修复nginx proxy_protocol 400报错问题、修改xray-core嗅探问题
Browse files Browse the repository at this point in the history
  • Loading branch information
mack-a committed Feb 7, 2024
1 parent 0607f1f commit 5b7e158
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1433,8 +1433,12 @@ EOF

cat <<EOF >>${nginxConfigPath}alone.conf
server {
listen 127.0.0.1:31300;
listen 127.0.0.1:31300 proxy_protocol;
server_name ${domain};
set_real_ip_from 0.0.0.0/0;
real_ip_header proxy_protocol;
root ${nginxStaticPath};
location ~ ^/s/(clashMeta|default|clashMetaProfiles)/(.*) {
proxy_set_header X-Real-IP \$proxy_protocol_addr;
Expand Down Expand Up @@ -3974,6 +3978,7 @@ EOF
elif [[ -z "$3" ]]; then
rm /etc/v2ray-agent/xray/conf/06_VLESS_gRPC_inbounds.json >/dev/null 2>&1
fi

# VLESS Vision
if echo "${selectCustomInstallType}" | grep -q ",0," || [[ "$1" == "all" ]]; then

Expand Down Expand Up @@ -6193,12 +6198,12 @@ unInstallSniffing() {
installSniffing() {
readInstallType
if [[ "${coreInstallType}" == "1" ]]; then
find ${configPath} -name "*inbounds.json*" | awk -F "[c][o][n][f][/]" '{print $2}' | while read -r inbound; do
if ! grep -q "destOverride" <"${configPath}${inbound}"; then
sniffing=$(jq -r '.inbounds[0].sniffing = {"enabled":true,"destOverride":["http","tls","quic"]}' "${configPath}${inbound}")
echo "${sniffing}" | jq . >"${configPath}${inbound}"
if [[ -f "${configPath}02_VLESS_TCP_inbounds.json" ]]; then
if ! grep -q "destOverride" <"${configPath}02_VLESS_TCP_inbounds.json"; then
sniffing=$(jq -r '.inbounds[0].sniffing = {"enabled":true,"destOverride":["http","tls","quic"]}' "${configPath}02_VLESS_TCP_inbounds.json")
echo "${sniffing}" | jq . >"${configPath}02_VLESS_TCP_inbounds.json"
fi
done
fi
fi
}

Expand Down Expand Up @@ -8736,7 +8741,7 @@ menu() {
cd "$HOME" || exit
echoContent red "\n=============================================================="
echoContent green "作者:mack-a"
echoContent green "当前版本:v3.2.7"
echoContent green "当前版本:v3.2.8"
echoContent green "Github:https://github.com/mack-a/v2ray-agent"
echoContent green "描述:八合一共存脚本\c"
showInstallStatus
Expand Down

0 comments on commit 5b7e158

Please sign in to comment.