bannedbook / fanqiang

翻墙-科学上网
37.59k stars 7.2k forks source link

v2ray服务端出站使用tor,入站流量也进不去,如何配置 #859

Open RecoveryAshes opened 7 months ago

RecoveryAshes commented 7 months ago

这是我的v2的config配置和nginx的配置,不知道问题在哪,大佬帮忙看看。域名已经指向服务器了 `{ "log": { "access": "/root/v2ray/log/access.log", "error": "/root/v2ray/log/error.log", "loglevel": "warning" }, "inbounds": [ { "port": 1080, "listen": "127.0.0.1", "protocol": "vmess", "settings": { "clients": [ { "id": "**", "level": 1, "alterId": 64 } ]

    },
    "streamSettings": {
        "network": "ws",
        "wsSettings": {
          "path": "/******8"
        }
      }
  }
],
"outbounds": [
  {
    "protocol": "freedom",
    "settings": {},
    "tag": "direct"
  },
  {
    "protocol": "blackhole",
    "settings": {},
    "tag": "blocked"
  },
  {
    "protocol": "socks",
    "tag": "tor1",
    "settings": {
      "servers": [
        {
          "address": "127.0.0.1",
          "port": 38801
        }
      ]
    }
  },
  {
    "tag": "tor2",
    "protocol": "socks",
    "settings": {
      "servers": [
        {
          "address": "127.0.0.1",
          "port": 38802
        }
      ]
    }
  },
  {
    "tag": "tor3",
    "protocol": "socks",
    "settings": {
      "servers": [
        {
          "address": "127.0.0.1",
          "port": 38803
        }
      ]
    }
  },
  {
    "tag": "tor4",
    "protocol": "socks",
    "settings": {
      "servers": [
        {
          "address": "127.0.0.1",
          "port": 38804
        }
      ]
    }
  },
  {
    "tag": "tor5",
    "protocol": "socks",
    "settings": {
      "servers": [
        {
          "address": "127.0.0.1",
          "port": 38805
        }
      ]
    }
  },
  {
    "tag": "tor6",
    "protocol": "socks",
    "settings": {
      "servers": [
        {
          "address": "127.0.0.1",
          "port": 38806
        }
      ]
    }
  },
  {
    "tag": "tor7",
    "protocol": "socks",
    "settings": {
      "servers": [
        {
          "address": "127.0.0.1",
          "port": 38807
        }
      ]
    }
  },
  {
    "tag": "tor8",
    "protocol": "socks",
    "settings": {
      "servers": [
        {
          "address": "127.0.0.1",
          "port": 38808
        }
      ]
    }
  },
  {
    "tag": "tor9",
    "protocol": "socks",
    "settings": {
      "servers": [
        {
          "address": "127.0.0.1",
          "port": 38809
        }
      ]
    }
  },
  {
    "protocol": "socks",
    "tag": "tor10",
    "settings": {
      "servers": [
        {
          "address": "127.0.0.1",
          "port": 38810
        }
      ]
    }
  }

],
"routing": {
  "rules": [
    {
      "type": "field",
      "ip": ["geoip:private"],
      "outboundTag": "direct"
    },
    {
      "type": "field",
      "domain": ["geosite:category-ads"],
      "outboundTag": "blocked"
    },
    {
      "type": "field",
      "network": "ws",
      "balancerTag": "tor-balance"
    }
  ],
  "balancers": [
    {
      "tag": "tor-balance",
      "selector": ["tor1", "tor2", "tor3", "tor4", "tor5", "tor6", "tor7", "tor8", "tor9", "tor10"]
    }
  ]
}

}`

`server{ listen 80; server_name ***;

root /your/path;

index index.html;

} server { listen 443 ssl http2 default_server; server_name v2.finalline.net; ssl_certificate /etc/letsencrypt/live/**/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/****/privkey.pem;

root /your/path;

index index.html;

location /finalhades { proxy_redirect off; proxy_pass http://127.0.0.1:1080; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $http_host; } } `