本文介绍如何使用 NGINX 对本地 vmess+ws 进行反代,以及如何使用 NGINX 对 vmess+ws+tls 进行中转。
搭建 vmess+ws 请参考
反代本地 vmess+ws
location /YOUR_PATH { proxy_redirect off; proxy_pass http://127.0.0.1:YOUR_V2RAY_PORT; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; # Show realip in v2ray access.log proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; }
反代(中转) vmess+ws+tls
location /YOUR_ANOTHER_PATH { proxy_pass https://YOUR_REMOTE_DOMAIN/YOUR_ANOTHER_PATH; proxy_set_header Host YOUR_REMOTE_DOMAIN:443; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Proto https; }
发表评论