• 本帖最后由 skywing 于 2018-12-13 16:14 编辑 *

v2r 端口监听正常

  • netstat -anp |grep v2ray
  • tcp 0 0 127.0.0.1:10289 0.0.0.0:* LISTEN 6827/v2ray复制代码

nginx配置

  • location /download {
  • proxy_redirect off;
  • proxy_pass http://127.0.0.1:10289;
  • proxy_http_version 1.1;
  • proxy_set_header Upgrade $http_upgrade;
  • proxy_set_header Connection "upgrade";
  • proxy_set_header Host $http_host;
  • }复制代码

v2r服务端配置

  • 2 "inbounds": [{
  • 3 "port": 10289,
  • 4 "listen": "127.0.0.1",
  • 5 "protocol": "vmess",
  • 6 "settings": {
  • 7 "clients": [
  • 8 {
  • 9 "id": "idididididididididid",
  • 10 "level": 1,
  • 11 "alterId": 64
  • 12 }
  • 13 ]
  • 14 },
  • 15 "streamSetting": {
  • 16 "network": "ws",
  • 17 "wsSettings": {
  • 18 "path": "/download"
  • 19 }
  • 20 }
  • 21 }]复制代码

v2r客户端配置

  • "outbounds": [{
  • // Protocol name of the outbound proxy.
  • "protocol": "vmess",
  • - // Settings of the protocol. Varies based on protocol.
  • "settings": {
  • "vnext": [
  • {
  • "address": "domain.com",
  • "port": 443,
  • "users": [
  • {
  • "id": "ididididididididididid",
  • "alterId": 64
  • }
  • ]
  • }
  • ]
  • },
  • "streamSettings": {
  • "network": "ws",
  • "security": "tls",
  • "wsSettings": {
  • "path": "/download"
  • }
  • },
  • - // Tag of the outbound. May be used for routing.
  • "tag": "direct"
  • },{
  • "protocol": "blackhole",
  • "settings": {},
  • "tag": "blocked"
  • }]复制代码

无法连接,老是提示404错误
客户端日志

  • 2018/12/13 11:21:25 [2321100519] v2ray.com/core/app/proxyman/outbound: failed to process outbound traffic > v2ray.com/core/proxy/vmess/outbound: failed to find an available destination > v2ray.com/core/common/retry: [v2ray.com/core/transport/internet/websocket: failed to dial WebSocket > v2ray.com/core/transport/internet/websocket: failed to dial to (wss://domain.com/download): 404 Not Found > websocket: bad handshake] > v2ray.com/core/common/retry: all retry attempts failed复制代码

nginx日志

  • 116.xx.xx.xx - - [13/Dec/2018:11:21:26 +0800] "GET /download HTTP/1.1" 404 162 "-" "Go-http-client/1.1"复制代码

为什么老是404错误呢?
————————————————————————————————————————

更新:好了,好像是V2R服务器默认的出站配置的问题

  • "outbounds": [{
  • "protocol": "freedom",
  • "settings": {}
  • },{
  • "protocol": "blackhole",
  • "settings": {},
  • "tag": "blocked"
  • }],
  • "routing": {
  • "rules": [
  • {
  • "type": "field",
  • "ip": ["geoip:private"],
  • "outboundTag": "blocked"
  • }
  • ]
  • }复制代码

把后面的都删掉保留前面的

  • "outbounds": [
  • "protocol": "freedom",
  • "settings": {}
  • ]
  • 复制代码

再重启V2R就好了。
很奇怪,出站设置居然会导致这样的问题。出站流量并没有"blocked"的"tag"啊