docker pull teddysun/v2ray
mkdir -p /etc/v2ray
wget --no-check-certificate -qO- 'http://ip.x1t.cc/v2/config.json' > /etc/v2ray/config.json
docker run -d -p 4679:4679 --name v2ray --restart=always -v /etc/v2ray:/etc/v2ray teddysun/v2ray
location /ws {
# 与 V2Ray 配置中的 path 保持一致
proxy_redirect off;
proxy_pass http://127.0.0.1:4679;
#假设WebSocket监听在环回地址的10000端口上
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
# Show realip in v2ray access.log
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}