-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimize external_ui url #2386
Optimize external_ui url #2386
Conversation
* Optimize external_ui url * Add dashboard_forward_ssl option * Add translation for dashboard_forward_ssl option * fix translation * Fix dashboard url when forward_domain is empty * Fix dashboard url description
请问这个修改在nginx作为web服务器的环境下有测试过吗? |
这个pr并不能自动支持https,而是当你配置了https反向代理之后(例如使用nginx配置了https反向代理),可以通过这个选项,则控制台才能跳转到正确的地址。不是说勾了就启用https了,而是勾了之后链接就变成https了。 |
您指的是反代哪个路径啊?
我们的luci本身是配置了https的,但dashboard的链接带上https之后就不能正常访问了。
需要说明的是,我们的固件是用nginx代替了uhttpd,不是用nginx反代uhttpd。
所以想问一下,您的uhttpd用例除了为luci配置https以外,还做了什么额外的配置吗?
Curious<https://curious.host>
…________________________________
From: xiaozhuai, Weihang Ding ***@***.***>
Sent: Friday, March 31, 2023 2:12:42 PM
To: vernesong/OpenClash ***@***.***>
Cc: Curious ***@***.***>; Comment ***@***.***>
Subject: Re: [vernesong/OpenClash] Optimize external_ui url (PR #2386)
请问这个修改在nginx作为web服务器的环境下有测试过吗?
#2913<#2913>
这个问题似乎不是孤例。我们都是用luci-nginx-ssl的环境并且为luci部署了域名访问和有效证书。
但在这个环境下,勾选了dashboard_forward_ssl之后,通过域名访问面板反而失败了。
这个pr并不能自动支持https,而是当你配置了https反向代理之后(例如使用nginx配置了https反向代理),可以通过这个选项,则控制台才能跳转到正确的地址。不是说勾了就启用https了,而是勾了之后链接就变成https了。
―
Reply to this email directly, view it on GitHub<#2386 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AEWR25UVE4PX7RZXEZINBD3W6ZYVVANCNFSM5WAVMSHQ>.
You are receiving this because you commented.Message ID: ***@***.***>
|
和uhttpd没有关系,dashboard的服务是由clash提供的,所以你配置uhttpd支持了https并不表示dashboard就支持https了。 |
|
比如说你的clash dashboard的端口是9090,http协议,只能内网访问 |
这个功能是面向高级用户的。普通用户保持默认设置即可。普通用户也搞不明白应该怎么做,所以我认为没必要详细说明。 |
了解了,谢谢。 |
提一句:Yacd和Dashboard这两个面板要通过nginx反代ssl,都需要通过WebSocket的配置方式 |
我设置了反代,开了 openclash 里面的 ssl 选项,但是只能且换节点不能看到日志和连接信息。请教一下应该怎么配置 Nginx。
|
|
这个页面失效了,请问这个问题是通过什么方法解决的呢? |
搞定,感谢 |
优化yacd和dashboard的url,都使用clash来提供服务
*
yacd
的url改为${external-controller}/ui/yacd
*
dashboard
的url改为${external-controller}/ui/dashboard
为什么要改url,由于我的luci可以外网访问,且使用https协议。
之前的yacd是使用uhttpd提供服务的,即https协议,而clash的api服务为http协议,
此时在新版的Chrome浏览器触发
Mixed Content
安全问题而被禁止api请求。即无法在https页面调用http接口。
具体修改如下:
/etc/init.d/openclash
中启动时创建yacd目录的symbol link/usr/share/openclash/yacd
和/usr/share/openclash/dashboard
到/usr/share/openclash/ui
目录下/usr/share/openclash/res/default.yaml
和配置脚本/usr/share/openclash/yml_change.sh
中的external-ui
为/usr/share/openclash/ui
status.htm
以使用新的urldashboard_forward_ssl
选项,用以控制外网转发端口是否启用了SSL这么改完之后,还有一个好处,可以统一对
9090
端口进行反向代理,增加https支持。这样一来,在外部控制中增加一个公网访问是否开启了SSL选项即可
实际上还存在另外一个同样的问题,即通过websocket协议获取流量和连接信息的api。见下述代码片段
OpenClash/luci-app-openclash/luasrc/view/openclash/status.htm
Lines 304 to 314 in 6b111db
在我的使用场景下,会尝试使用
wss
协议连接clash的接口,很明显clash的api提供的是ws
服务,而无法提供wss
。但也无法简单的修改协议为
ws
,改为ws
同样会遇到Mixed Content
问题。但是实际使用时发现并不影响,应该是走了另外一个
toolbar_show
接口。因此在想这个websocket连接的代码是否可以去掉,看起来并没有用。