v2ray / discussion

For general discussion over Project V development and usage.
298 stars 34 forks source link

V2ray+Nginx+TLS无法连接,求大神们指点一下。 #218

Closed Mr-Kwok closed 5 years ago

Mr-Kwok commented 5 years ago

各位大神,我用的是V2ray-GO+Nginx+TLS V2ray服务端正常启动。 Nginx正常启动 80、443端口可正常访问。 改成个人使用TCP协议可正常访问,改成V2ray+Nginx+TLS+SSRPanel后google浏览器左下角一直提示正在建立安全连接...... 使用小火箭延迟测试443端口可显示ping值。 V2ray服务端无日志。 ———————————————————————————————————— V2ray客户端日志: V2Ray 4.18.0 (Po) 20190228 A unified platform for anti-censorship. 127.0.0.1 - - [26/Apr/2019 10:42:17] "GET /pac/pac.js HTTP/1.1" 200 - 127.0.0.1 - - [26/Apr/2019 10:42:17] "GET /pac/pac.js HTTP/1.1" 200 - 127.0.0.1 - - [26/Apr/2019 10:42:17] "GET /pac/pac.js HTTP/1.1" 200 - 127.0.0.1 - - [26/Apr/2019 10:42:17] "GET /pac/pac.js HTTP/1.1" 200 - 127.0.0.1 - - [26/Apr/2019 10:42:17] "GET /pac/pac.js HTTP/1.1" 200 - 127.0.0.1 - - [26/Apr/2019 10:44:22] "GET /pac/pac.js HTTP/1.1" 200 - 127.0.0.1 - - [26/Apr/2019 10:51:00] "GET /pac/pac.js HTTP/1.1" 200 - V2ray服务端配置: { "log": { "loglevel": "debug" }, "api": { "tag": "api", "services": [ "HandlerService", "LoggerService", "StatsService" ] }, "stats": {}, "inbounds": [ { "listen": "127.0.0.1", "port": 10087, "protocol": "dokodemo-door", "settings": { "address": "127.0.0.1" }, "tag": "api" }, { "tag": "proxy", "port":10000, "protocol": "vmess", "settings": { "clients": [], "disableInsecureEncryption": false, "default": { "level": 0, "alterId": 16 } }, "streamSettings": { "network": "ws", "wsSettings": { "path": "/game" } } } ], "outbounds": [{ "protocol": "freedom" }], "routing": { "rules": [{ "type": "field", "inboundTag": [ "api" ], "outboundTag": "api" }],
"strategy": "rules" }, "policy": { "levels": { "0": { "statsUserUplink": true, "statsUserDownlink": true } }, "system": { "statsInboundUplink": true, "statsInboundDownlink": true } },

"ssrpanel": { // Node id on your SSR Panel "nodeId": 1, // every N seconds "checkRate": 300, // user config "user": { // inbound tag, which inbound you would like add user to "inboundTag": "proxy", "level": 1, "alterId": 16, "security": "none" }, // db connection "mysql": { "host": "xxx.com", "port": 3306, "user": "xxxx", "password": "xxxx", "dbname": "ssrpanel" } } } ———————————————————————————————————————— Nginx填下以下配置: location /websocket/ { 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; } —————————————————————————————————————— V2rayU客户端配置: { "log": { "error": "", "loglevel": "none", "access": "" }, "inbound": { "listen": "127.0.0.1", "protocol": "socks", "settings": { "ip": "", "userLevel": 0, "timeout": 360, "udp": true, "auth": "noauth" }, "port": "1080" }, "inboundDetour": [ { "listen": "127.0.0.1", "protocol": "http", "settings": { "timeout": 360 }, "port": "1087" } ], "outbound": { "mux": { "enabled": true, "concurrency": 8 }, "protocol": "vmess", "streamSettings": { "wsSettings": { "path": "/game", "headers": { "host": "" } }, "tlsSettings": { "serverName": "xxx.com", "allowInsecure": true }, "security": "tls", "network": "ws" }, "tag": "agentout", "settings": { "vnext": [ { "address": "xxxx.com", "users": [ { "id": "c6effafd-6046-7a84-376e-b04297518888", "alterId": 16, "level": 1, "security": "aes-128-gcm" } ], "port": 443 } ] } }, "outboundDetour": [ { "tag": "direct", "protocol": "freedom", "settings": { "domainStrategy": "AsIs", "redirect": "", "userLevel": 0 } }, { "tag": "blockout", "protocol": "blackhole", "settings": { "response": { "type": "none" } } } ], "dns": { "servers": [ "" ] }, "routing": { "strategy": "rules", "settings": { "domainStrategy": "IPIfNonMatch", "rules": [ { "outboundTag": "direct", "type": "field", "ip": [ "geoip:cn", "geoip:private" ], "domain": [ "geosite:cn", "geosite:speedtest" ] } ] } }, "transport": {} }

Mr-Kwok commented 5 years ago

系统时间也是同步的。

kslr commented 5 years ago

没有日志说明服务没收到数据。 你的两个Path并不一致

game and websocket

Mr-Kwok commented 5 years ago

Nginx里面的location /websocket/ {要改成location /gmae/ {是吗?

kslr commented 5 years ago

location /game

Mr-Kwok notifications@github.com 于 2019年4月26日周五 11:26写道:

Nginx里面的location /websocket/ {要改成location /gmae/ {是吗?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/v2ray/discussion/issues/218#issuecomment-486912387, or mute the thread https://github.com/notifications/unsubscribe-auth/ABKCYI33XQLI4WTNHEEPWI3PSJY43ANCNFSM4HISDFEA .

Mr-Kwok commented 5 years ago

location / game Mr-Kwok notifications@github.com于2019年4月26日周五11:26写道: ... Nginx里面的位置/ websocket / {要改成位置/ gmae / {是吗? - 你收到这个是因为你发表了评论。直接回复此电子邮件,在GitHub上查看< #218(评论) >,或将线程静音< https://github.com/notifications/unsubscribe-auth/ABKCYI33XQLI4WTNHEEPWI3PSJY43ANCNFSM4HISDFEA >。

Nginx已经改成了location / game也重启了Nginx,但问题依旧。

kslr commented 5 years ago

我刚才没注意,你这个配置从哪弄来的,怎么还有ssrpanel

Mr-Kwok notifications@github.com 于 2019年4月26日周五 11:37写道:

location / game Mr-Kwok notifications@github.com于2019年4月26日周五11:26写道: ... <#m_9004311662489962526m-2866868647052578436_> Nginx里面的位置/ websocket / {要改成位置/ gmae / {是吗? - 你收到这个是因为你发表了评论。直接回复此电子邮件,在GitHub上查看< #218(评论) https://github.com/v2ray/discussion/issues/218#issuecomment-486912387

,或将线程静音< https://github.com/notifications/unsubscribe-auth/ABKCYI33XQLI4WTNHEEPWI3PSJY43ANCNFSM4HISDFEA

Nginx已经改成了location / game也重启了Nginx,但问题依旧。

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/v2ray/discussion/issues/218#issuecomment-486913982, or mute the thread https://github.com/notifications/unsubscribe-auth/ABKCYI7KYWZ5JX4RXHNB6F3PSJ2FZANCNFSM4HISDFEA .

Mr-Kwok commented 5 years ago

location / game Mr-Kwok notifications@github.com于2019年4月26日周五11:26写道: ... Nginx里面的位置/ websocket / {要改成位置/ gmae / {是吗? - 你收到这个是因为你发表了评论。直接回复此电子邮件,在GitHub上查看< #218(评论) >,或将线程静音< https://github.com/notifications/unsubscribe-auth/ABKCYI33XQLI4WTNHEEPWI3PSJY43ANCNFSM4HISDFEA >。

改好了,改成了/V2ray就没问题了,请问大神这个路径是啥意思啊?改什么都不行,就改成V2ray就好了。

Mr-Kwok commented 5 years ago

我刚才没注意,你这个配置从哪弄的,怎么还有ssrpanel先生notifications@github.com于2019年4月26日周五11:37写道: ... location / game Mr-Kwok @。***于2019年4月26日周五11:26写道:... <#m_9004311662489962526m-2866868647052578436_> Nginx里面的位置/ websocket / {要改成位置/ gmae / {是吗? - 你收到这个是因为你发表了评论。直接回复此电子邮件,在GitHub上查看<#218(评论)< #218(comment) >>,或将线程静音< https://github.com/notifications/unsubscribe-auth/ABKCYI33XQLI4WTNHEEPWI3PSJY43ANCNFSM4HISDFEA > .Nginx已经改成了位置/游戏也重启了Nginx,但问题依旧。 - 你收到这个因为你评论了。直接回复此电子邮件,在GitHub上查看< #218(评论) >,或将线程静音< https://github.com/notifications/unsubscribe-auth/ABKCYI7KYWZ5JX4RXHNB6F3PSJ2FZANCNFSM4HISDFEA >。 http://sobaigu.com/ssrpanel-v2ray-go.html 复制这个上面的配置。

kslr commented 5 years ago

@Mr-Kwok 你有telegram的联系方式吗,想找你帮忙调试

Mr-Kwok commented 5 years ago

@先生,郭氏你有电报的联系方式吗,想找你帮忙调试

有但是不太会用,@alrale666,你试试能加我吗?

Mit2g commented 5 years ago

location / game Mr-Kwok notifications@github.com于2019年4月26日周五11:26写道: ... Nginx里面的位置/ websocket / {要改成位置/ gmae / {是吗? - 你收到这个是因为你发表了评论。直接回复此电子邮件,在GitHub上查看< #218(评论) >,或将线程静音< https://github.com/notifications/unsubscribe-auth/ABKCYI33XQLI4WTNHEEPWI3PSJY43ANCNFSM4HISDFEA >。

改好了,改成了/V2ray就没问题了,请问大神这个路径是啥意思啊?改什么都不行,就改成V2ray就好了。

nginx内location的路径要与v2内path路径一致

kslr commented 5 years ago

@Mr-Kwok 不好意思,最近事情频发有机会再联系

MonsterEdward commented 5 years ago

@Mr-Kwok 不好意思,最近事情频发有机会再联系

server无法正常运行,loglevel是debug,但无日志。/usr/bin/v2ray/v2ray info发现有错误,但service v2ray status显示正常运行。https://github.com/v2ray/discussion/issues/259