为了配置v2ray ws+tls可真是个糟心事。按照教程走的时候,先是v2ray日志一直报的json格式问题,然后去github找了份配置,刚开始可以用,在经过自己几次更改之后不知道出现了什么问题GG,然后重新copy后居然不能用了,然后佛系重启几次居然又自己好了,真是见鬼!
下面放下配置,省的之后出问题
nginx配置
server {
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;
ssl on;
ssl_certificate /www/server/panel/vhost/cert/vps.honus.top/fullchain.pem;
ssl_certificate_key /www/server/panel/vhost/cert/vps.honus.top/privkey.pem;
root /www/wwwroot/vps.honus.top;
location /panel/ {
proxy_redirect off;
proxy_pass http://127.0.0.1:10000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
}
}
v2ray配置
{
"log": {
"loglevel": "info",
"access": "/var/log/v2ray/access.log",
"error": "/var/log/v2ray/error.log"
},
"inbounds": [
{
"port": 10000,
"listen":"0.0.0.0",
"protocol":"vmess",
"settings": {
"clients": [
{
"id": "6fdd86cf-a9fb-47bf-b471-ffcf47ab76d5",
"level": 1,
"alterId": 16
}
]
},
"sniffing": {
"enabled": true,
"destOverride": ["http", "tls"]
},
"streamSettings": {
"network": "ws",
"security": "auto",
"wsSettings": {
"path": "/panel/"
}
}
}
],
"outbounds": [
{
"tag":"IP4_out",
"protocol": "freedom",
"settings": {}
},
{
"tag":"IP6_out",
"protocol": "freedom",
"settings": {
"domainStrategy": "UseIPv6"
}
},
{
"tag": "blocked",
"protocol": "blackhole",
"settings": {}
}
],
"routing": {
"strategy": "rules",
"settings": {
"rules": [
{
"type": "field",
"outboundTag": "IP6_out",
"domain": ["geosite:netflix"]
},
{
"type": "field",
"outboundTag": "IP4_out",
"network": "udp,tcp"
},
{
"type": "field",
"outboundTag": "blocked",
"ip": [
"0.0.0.0/8",
"10.0.0.0/8",
"100.64.0.0/10",
"127.0.0.0/8",
"169.254.0.0/16",
"172.16.0.0/12",
"192.0.0.0/24",
"192.0.2.0/24",
"192.168.0.0/16",
"198.18.0.0/15",
"198.51.100.0/24",
"203.0.113.0/24",
"::1/128",
"fc00::/7",
"fe80::/10"
]
}
]
}
}
}
使用DNS解锁netflix配置
{
"log": {
"loglevel": "info",
"access": "/var/log/v2ray/access.log",
"error": "/var/log/v2ray/error.log"
},
"dns": {
"servers": [
{
"address": "103.150.8.183", // 购买的 DNS 解锁提供的 IP
"port": 53,
"domains": [
"domain:netflix.com",
"domain:netflix.net",
"domain:nflximg.net",
"domain:nflxvideo.net",
"domain:nflxso.net",
"domain:nflxext.com"
]
},
"localhost"
]
},
"inbounds": [
{
"port": 10000,
"listen":"0.0.0.0",
"protocol":"vmess",
"settings": {
"clients": [
{
"id": "6fdd86cf-a9fb-47bf-b471-ffcf47ab76d5",
"level": 1,
"alterId": 16
}
]
},
"sniffing": {
"enabled": true,
"destOverride": ["http", "tls"]
},
"streamSettings": {
"network": "ws",
"security": "auto",
"wsSettings": {
"path": "/panel/"
}
}
}
],
"outbounds": [
{
"tag":"IP4_out",
"protocol": "freedom",
"settings": {}
},
{
"tag":"DNS",
"protocol": "freedom",
"settings": {
"domainStrategy": "UseIP"
}
},
{
"tag": "blocked",
"protocol": "blackhole",
"settings": {}
}
],
"routing": {
"strategy": "rules",
"settings": {
"rules": [
{
"type": "field",
"outboundTag": "DNS",
"domain": ["geosite:netflix"]
},
{
"type": "field",
"outboundTag": "IP4_out",
"network": "udp,tcp"
},
{
"type": "field",
"outboundTag": "blocked",
"ip": [
"0.0.0.0/8",
"10.0.0.0/8",
"100.64.0.0/10",
"127.0.0.0/8",
"169.254.0.0/16",
"172.16.0.0/12",
"192.0.0.0/24",
"192.0.2.0/24",
"192.168.0.0/16",
"198.18.0.0/15",
"198.51.100.0/24",
"203.0.113.0/24",
"::1/128",
"fc00::/7",
"fe80::/10"
]
}
]
}
}
}
指定网站IPv6出口
{
"log": {
"loglevel": "info",
"access": "/var/log/v2ray/access.log",
"error": "/var/log/v2ray/error.log"
},
"dns": {
"servers": [
{
"address": "103.150.8.183", // 购买的 DNS 解锁提供的 IP
"port": 53,
"domains": [
"domain:netflix.com",
"domain:netflix.net",
"domain:nflximg.net",
"domain:nflxvideo.net",
"domain:nflxso.net",
"domain:nflxext.com"
]
},
"localhost"
]
},
"inbounds": [
{
"port": 10000,
"listen":"0.0.0.0",
"protocol":"vmess",
"settings": {
"clients": [
{
"id": "6fdd86cf-af9b-4b7f-b471-ffcf47ab44d5",
"level": 1,
"alterId": 32
}
]
},
"sniffing": {
"enabled": true,
"destOverride": ["http", "tls"]
},
"streamSettings": {
"network": "ws",
"security": "auto",
"wsSettings": {
"path": "/panel/"
}
}
}
],
"outbounds": [
{
"tag":"IP4_out",
"protocol": "freedom",
"settings": {}
},
{
"tag":"IP6_out",
"protocol": "freedom",
"settings": {
"domainStrategy": "UseIPv6"
}
},
{
"tag":"DNS",
"protocol": "freedom",
"settings": {
"domainStrategy": "UseIP"
}
},
{
"tag": "blocked",
"protocol": "blackhole",
"settings": {}
}
],
"routing": {
"strategy": "rules",
"settings": {
"rules": [
{
"type": "field",
"outboundTag": "DNS",
"domain": ["geosite:netflix"]
},
{
"type": "field",
"outboundTag": "IP6_out",
"domain": ["geosite:google"]
},
{
"type": "field",
"outboundTag": "IP4_out",
"network": "udp,tcp"
},
{
"type": "field",
"outboundTag": "blocked",
"ip": [
"0.0.0.0/8",
"10.0.0.0/8",
"100.64.0.0/10",
"127.0.0.0/8",
"169.254.0.0/16",
"172.16.0.0/12",
"192.0.0.0/24",
"192.0.2.0/24",
"192.168.0.0/16",
"198.18.0.0/15",
"198.51.100.0/24",
"203.0.113.0/24",
"::1/128",
"fc00::/7",
"fe80::/10"
]
}
]
}
}
}