我试图弄清楚如何让noVNC通过反向代理工作,虽然它可以直接连接到它,但如果我尝试反向代理,它似乎就不起作用了。
即:
我以./utils/launch.sh --vnc localhost:5901的身份运行它
如果我以https://<machine>:6080/vnc.html?host=<machine>&port=6080的形式连接到它
它工作正常,我可以连接到vnc会话。
但是,我希望能够通过端口443上的反向代理连接到它。
在Apache2.4.10( Debian中的-8)中,我将代理行配置为
ProxyPass /home http://127.0.0.1:6080/
ProxyPassReverse /home http://127.0.0.1:6080/
ProxyPass /websockify wss://127.0.0.1:6080/websockify retry=3
ProxyPassReverse /websockify wss://127.0.0.1:6080/websockify retry=3我作为https://<machine>/vnc.html?host=<machine>&port=6080连接到它
这仍然有效,因为当html/javascript的获取通过反向代理时,我仍然告诉websocket连接超过6080,并且它可以工作。
但是,当我将它更改为https://<machine>/vnc.html?host=<machine>&port=443时
我可以得到html/javascript,但是当它建立连接时,在firefox (以及chrome和IE中,但是这个错误来自火狐)我很快就会得到
Firefox can't establish a connection to the server at wss://<machine>/websockify.在noVNC中,我看到了错误消息
127.0.0.1: ignoring socket not ready发布于 2015-01-05 17:06:36
结果是,如果希望通过https代理代理websockets,则应该将代理部分设置为普通websockets (ws://),而不是安全的web套接字(wss://),这是有意义的,因为https代理已经处理了ssl部分,没有什么可做的。
ProxyPass /websockify ws://127.0.0.1:6080/websockify retry=3
ProxyPassReverse /websockify ws://127.0.0.1:6080/websockify retry=3改变一下一切就行了。
https://stackoverflow.com/questions/27721855
复制相似问题