全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
查看: 1458|回复: 5

[nginx] 技术讨论ws+tls+Nginx修改端口问题

[复制链接]
发表于 2023-9-17 01:48:01 | 显示全部楼层 |阅读模式
本帖最后由 好男人文哥 于 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正常
发表于 2023-9-17 01:59:45 | 显示全部楼层
这里
    if ($server_port !~ 443){
        rewrite ^(/.*)$ https://$host$1 permanent;
    }
发表于 2023-9-17 02:00:53 来自手机 | 显示全部楼层
已经被检查的搭墙方式,研究没有意义
发表于 2023-9-17 02:08:54 | 显示全部楼层
当面教,当面抓




* 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:04 | 显示全部楼层
xiaoqiang1998 发表于 2023-9-17 01:59
这里
    if ($server_port !~ 443){
        rewrite ^(/.*)$ https://$host$1 permanent;

location /
 楼主| 发表于 2023-9-17 02:10:05 | 显示全部楼层
gzk101 发表于 2023-9-17 02:00
已经被检查的搭墙方式,研究没有意义

现在有什么好的吗
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2024-4-28 17:42 , Processed in 0.062968 second(s), 8 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表