我在试着用阿帕奇代理cockpit1
它会打开登录界面,但登录后出现空白屏幕,没有错误,什么都没有。在开发工具中,我发现了一个ws错误Error during WebSocket handshake: Unexpected response code: 400
cockpit ws守护进程在其日志中输出此信息
cockpit-ws[14523]: received invalid or missing Upgrade header: (null)
cockpit-ws[14523]: Received invalid handshake request from the client
cockpit-ws[14523]: WebSocket from 192.168.123.2 for session closed我在带有驾驶舱195的Centos7上运行
下面是相关的配置部分
ProxyPreserveHost On
ProxyRequests Off
# allow for upgrading to websockets
RewriteEngine On
RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC]
RewriteCond %{HTTP:CONNECTION} ^Upgrade$ [NC]
RewriteRule .* ws://192.168.123.2:9090/%{REQUEST_URI} [P]
# Proxy to your local cockpit instance
ProxyPass / http://192.168.123.2:9090/
ProxyPassReverse / http://192.168.123.2:9090/ 是的,我知道我没有使用虚拟主机,我正在尝试让它在/cockpit url上工作,但这是另一个问题
这是/etc/cockpit/cockpit.conf
[WebService]
Origins = https://192.168.123.2:9090 wss://192.168.123.2:9090 http://192.168.123.2 ws://192.168.123.2
ProtocolHeader = X-Forwarded-Proto
AllowUnencrypted = true 发布于 2020-06-23 00:55:45
遇到同样的问题,我忘记启用proxy_wstunnel模块。
sudo a2enmod proxy proxy_wstunnel proxy_http ssl rewritehttps://github.com/cockpit-project/cockpit/wiki/Proxying-Cockpit-over-Apache-with-LetsEncrypt中描述了整个Apache代理设置。
https://stackoverflow.com/questions/59853425
复制相似问题