Closed Nehcknarf closed 3 years ago
h2c://xray:2002
改成 grpc://xray:2002
试试
不行就换成 nginx
location /Neo {
grpc_pass grpc://xray:2002;
}
我就是caddy2配置没成功,换成nginx的.
h2c://xray:2002
改成grpc://xray:2002
试试 不行就换成 nginxlocation /Neo { grpc_pass grpc://xray:2002; }
我就是caddy2配置没成功,换成nginx的.
成功了!虽然不是你说的问题,但是还是很感谢。你可以试下我的caddy方案。
docker run -d --name caddy --network=my-net --restart=always \
-v /etc/caddy/Caddyfile:/etc/caddy/Caddyfile \
-v /etc/caddy/data:/data \
-v /etc/caddy/config:/config \
-p 80:80 -p 443:443 \
caddy
较之前的版本删去了多余的指令
docker run -d --name xray --network=my-net --restart=always \
-v /etc/xray:/etc/xray \
teddysun/xray
xray容器可以无需端口映射
x.cyou {
@grpc {
protocol grpc
path /Neo/*
}
reverse_proxy @grpc h2c://xray:2002
root * /var/www
file_server
}
Caddyfile不变
{
"log": {
"loglevel": "warning"
},
"inbounds": [
{
"port": 2002,
"protocol": "vless",
"settings": {
"clients": [
{
"id": "xxxxxxxx"
}
],
"decryption": "none"
},
"streamSettings": {
"network": "grpc",
"grpcSettings": {
"serviceName": "Neo",
"multiMode": true
}
}
}
],
"outbounds": [
{
"tag": "direct",
"protocol": "freedom",
"settings": {}
},
{
"tag": "blocked",
"protocol": "blackhole",
"settings": {}
}
],
"routing": {
"domainStrategy": "AsIs",
"rules": [
{
"type": "field",
"ip": [
"geoip:private"
],
"outboundTag": "blocked"
}
]
}
}
xray服务端配置不变
{
"log": {},
"inbounds": [
{
"port": "10808",
"protocol": "socks",
"settings": {
"auth": "noauth",
"udp": true
}
},
{
"port": "10809",
"protocol": "http",
"settings": {}
}
],
"outbounds": [
{
"protocol": "vless",
"settings": {
"vnext": [
{
"address": "x.xxx",
"port": 443,
"users": [
{
"id": "xxxxxxx",
"encryption": "none"
}
]
}
]
},
"streamSettings": {
"network": "grpc",
"security": "tls",
"grpcSettings": {
"serviceName": "Neo"
}
}
},
{
"tag": "direct",
"protocol": "freedom",
"settings": {}
},
{
"tag": "blocked",
"protocol": "blackhole",
"settings": {}
}
],
"routing": {
"domainStrategy": "IPOnDemand",
"rules": [
{
"type": "field",
"ip": [
"geoip:private"
],
"outboundTag": "direct"
}
]
}
}
客户端serviceName暂时只保留 Neo,因为我用的V2rayN 4.13版本会自动在后面补/Tun,所以/TunMulti暂时不可用,别的客户端可以配置TunMulti
修改了新一版的配置,容器内可以相互ping通,但是客户端还是报503,求助各位大佬。 VPS防火墙是开放的,容器时区也已经同步,两容器日志均无异常记录(日志在原issue) 配置开启了multiMode 容器执行命令:
Caddyfile配置:
服务器配置:
客户端配置:
Originally posted by @Nehcknarf in https://github.com/XTLS/Xray-core/issues/483#issuecomment-817299919