全球主机交流论坛

标题: 技术讨论ws+tls+Nginx修改端口问题 [打印本页]

作者: 好男人文哥    时间: 2023-9-17 01:48
标题: 技术讨论ws+tls+Nginx修改端口问题
本帖最后由 好男人文哥 于 2023-9-17 02:11 编辑

方式:ws+tls+Nginx
如下图,想在v2里多一个端口,例11111,确认添加开放



之后客户端日志报错:
[Warning] failed to handler mux client connection > proxy/vmess/outbound: failed to find an available destination > common/retry: [transport/internet/websocket: failed to dial WebSocket > transport/internet/websocket: failed to dial to (wss://服务器IP:11111/路径/): 301 Moved Permanently > websocket: bad handshake] > common/retry: all retry attempts failed
网站日志:
"GET /路径/ HTTP/1.1" 301 162 "-" "Go-http-client/1.1"
到此为止我的思路按照跳转301排查,
然后F12看下请求:

发现奇葩的调转到原https://ip:443上去了(也就是网站默认端口)

然后再检查我的NGINX配置:

已解决:这里修改:
  location / {
                   if ($server_port !~ 443){
                   rewrite ^(/.*)$ https://$host$1 permanent;
    }
}


到此为止已经懵逼了,大佬们讨论下

PS:
1、NTP正常
2、443端口可用
3、IP正常
作者: xiaoqiang1998    时间: 2023-9-17 01:59
这里
    if ($server_port !~ 443){
        rewrite ^(/.*)$ https://$host$1 permanent;
    }
作者: gzk101    时间: 2023-9-17 02:00
已经被检查的搭墙方式,研究没有意义
作者: 冲浪麦浪花郎    时间: 2023-9-17 02:08
当面教,当面抓




* Linux常用命令:telinit 0 关闭系统



* 资源 https://t.me/MJJ_aliyundrive
* MJJ频道 https://t.me/wearemjj
* Linux命令大全 https://www.linuxcool.com
* DNS设置大全 https://dns.iui.im/
* 优质导航大全 https://www.chaidu.com/
* HostLoc频道 https://t.me/myhostloc
* A1Plus & G Suit & Workspace教育全局号https://sourl.cn/xq7iAZ
* OneDrive1T/5T网盘批发 iCloud苹果个人200G号https://nanguo.in/shop?ref=awtyBzywo
   
作者: 好男人文哥    时间: 2023-9-17 02:09
xiaoqiang1998 发表于 2023-9-17 01:59
这里
    if ($server_port !~ 443){
        rewrite ^(/.*)$ https://$host$1 permanent;

location /
作者: 好男人文哥    时间: 2023-9-17 02:10
gzk101 发表于 2023-9-17 02:00
已经被检查的搭墙方式,研究没有意义

现在有什么好的吗




欢迎光临 全球主机交流论坛 (https://91ai.net/) Powered by Discuz! X3.4