From 5f18955ff6ac2c847f22d58e3fc4c3181845158c Mon Sep 17 00:00:00 2001 From: xqzr <34030394+xqzr@users.noreply.github.com> Date: Fri, 13 Dec 2024 18:23:33 +0800 Subject: [PATCH 1/3] Create nginx.conf --- VLESS-XHTTP3-Nginx/nginx.conf | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 VLESS-XHTTP3-Nginx/nginx.conf diff --git a/VLESS-XHTTP3-Nginx/nginx.conf b/VLESS-XHTTP3-Nginx/nginx.conf new file mode 100644 index 0000000..c1387cd --- /dev/null +++ b/VLESS-XHTTP3-Nginx/nginx.conf @@ -0,0 +1,26 @@ +server { + listen [::]:443 ssl ipv6only=off reuseport; + listen [::]:443 quic reuseport ipv6only=off; + server_name example.com; + + index index.html; + root /var/www/html; + + http2 on; + ssl_certificate /path/to/example.cer; + ssl_certificate_key /path/to/example.key; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384; + + client_header_timeout 5m; + keepalive_timeout 5m; + # 在 location 后填写 /你的 path/ + location /你的 path/ { + client_max_body_size 0; + grpc_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + client_body_timeout 5m; + grpc_read_timeout 315; + grpc_send_timeout 5m; + grpc_pass unix:/dev/shm/xrxh.socket; + } +} From c1dc2f7c14a229770639a275422287779d4baa99 Mon Sep 17 00:00:00 2001 From: xqzr <34030394+xqzr@users.noreply.github.com> Date: Fri, 13 Dec 2024 18:29:48 +0800 Subject: [PATCH 2/3] Create server.jsonc --- VLESS-XHTTP3-Nginx/server.jsonc | 50 +++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 VLESS-XHTTP3-Nginx/server.jsonc diff --git a/VLESS-XHTTP3-Nginx/server.jsonc b/VLESS-XHTTP3-Nginx/server.jsonc new file mode 100644 index 0000000..5c8ea32 --- /dev/null +++ b/VLESS-XHTTP3-Nginx/server.jsonc @@ -0,0 +1,50 @@ +{ + "log": { + "loglevel": "warning" + }, + "inbounds": [ + { + "listen": "/dev/shm/xrxh.socket,0666", + "protocol": "vless", + "settings": { + "clients": [ + { + "id": "" // 填写你的 UUID + } + ], + "decryption": "none" + }, + "streamSettings": { + "network": "xhttp", + "xhttpSettings": { + "mode": "stream-one", + "path": "" // 填写你的 path + } + } + } + ], + "outbounds": [ + { + "tag": "direct", + "protocol": "freedom", + "settings": {} + }, + { + "tag": "blocked", + "protocol": "blackhole", + "settings": {} + } + ], + "routing": { + "domainStrategy": "AsIs", + "rules": [ + { + "type": "field", + "ip": [ + "geoip:private" + ], + "outboundTag": "blocked" + } + ] + } +} From a5ba55741dc5b1700ce5f3c66eae9c80f64306b4 Mon Sep 17 00:00:00 2001 From: xqzr <34030394+xqzr@users.noreply.github.com> Date: Fri, 13 Dec 2024 18:51:12 +0800 Subject: [PATCH 3/3] Create client.jsonc --- VLESS-XHTTP3-Nginx/client.jsonc | 71 +++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 VLESS-XHTTP3-Nginx/client.jsonc diff --git a/VLESS-XHTTP3-Nginx/client.jsonc b/VLESS-XHTTP3-Nginx/client.jsonc new file mode 100644 index 0000000..247461b --- /dev/null +++ b/VLESS-XHTTP3-Nginx/client.jsonc @@ -0,0 +1,71 @@ +{ + "log": {}, + "inbounds": [ + { + "port": "1080", + "listen": "::1", + "protocol": "socks", + "settings": { + "udp": true + } + } + ], + "outbounds": [ + { + "protocol": "vless", + "settings": { + "vnext": [ + { + "address": "example.com", + "port": 443, + "users": [ + { + "id": "" //填写你的 UUID + } + ] + } + ] + }, + "streamSettings": { + "network": "xhttp", + "xhttpSettings": { + "path": "", //填写你的 path + "mode": "stream-one", + "xmux": { + "maxConcurrency": 128, //Nginx 默认上限 128。https://nginx.org/en/docs/http/ngx_http_v3_module.html#http3_max_concurrent_streams + "cMaxReuseTimes": 1000, //Nginx 默认上限 1000。https://nginx.org/en/docs/http/ngx_http_core_module.html#keepalive_requests + "cMaxLifetimeMs": 3600000 //Nginx 默认上限 3600000ms(1h)。https://nginx.org/en/docs/http/ngx_http_core_module.html#keepalive_time + } + } + "security": "tls", + "tlsSettings": { + "alpn": [ + "h3" + ] + } + } + }, + { + "tag": "direct", + "protocol": "freedom", + "settings": {} + }, + { + "tag": "blocked", + "protocol": "blackhole", + "settings": {} + } + ], + "routing": { + "domainStrategy": "IPOnDemand", + "rules": [ + { + "type": "field", + "ip": [ + "geoip:private" + ], + "outboundTag": "direct" + } + ] + } +}