[GH-ISSUE #410] NoVNC Proxy in Docker #254

Closed
opened 2026-02-27 15:57:59 +03:00 by kerem · 1 comment
Owner

Originally created by @mchlrv on GitHub (Jan 30, 2021).
Original GitHub issue: https://github.com/retspen/webvirtcloud/issues/410

I'm running webvirtcloud in Docker and use Apache to proxy pass traffic to webvirtcloud in docker.
Everything seems to work when using non SSL (http). However when I'm trying to use SSL (https) everything seems to work except NoVNC.

I'm not sure what I forget or do wrong as this works for non SSL. Any suggestions?

My Apache proxy part looks as follow:

ProxyRequests Off

ProxyPass / http://localhost:8080/
ProxyPassReverse / http://localhost:8080/

ProxyPass /novncd/ ws://localhost:6080/novncd/ retry=3
ProxyPassReverse /novncd/ ws://locahost:6080/novncd/ retry=3

My webvirtcloud settings look like:

# Websock port
WS_PORT = 6080

# Websock host
WS_HOST = "0.0.0.0"

# Websock public port - 80 or 443 if reverse-proxy, else 6080
WS_PUBLIC_PORT = 443

# Websock public host
WS_PUBLIC_HOST = None

# Websock public path
WS_PUBLIC_PATH = "/novncd/"

When trying to connect to NoVNC and looking a the developer console the following error appears:

websock.js:185 WebSocket connection to 'wss://webvirtcloud:6080//novncd/' failed: Error in connection establishment: net::ERR_CONNECTION_RESET
Originally created by @mchlrv on GitHub (Jan 30, 2021). Original GitHub issue: https://github.com/retspen/webvirtcloud/issues/410 I'm running webvirtcloud in Docker and use Apache to proxy pass traffic to webvirtcloud in docker. Everything seems to work when using non SSL (http). However when I'm trying to use SSL (https) everything seems to work except NoVNC. I'm not sure what I forget or do wrong as this works for non SSL. Any suggestions? My Apache proxy part looks as follow: ``` ProxyRequests Off ProxyPass / http://localhost:8080/ ProxyPassReverse / http://localhost:8080/ ProxyPass /novncd/ ws://localhost:6080/novncd/ retry=3 ProxyPassReverse /novncd/ ws://locahost:6080/novncd/ retry=3 ``` My webvirtcloud settings look like: ``` # Websock port WS_PORT = 6080 # Websock host WS_HOST = "0.0.0.0" # Websock public port - 80 or 443 if reverse-proxy, else 6080 WS_PUBLIC_PORT = 443 # Websock public host WS_PUBLIC_HOST = None # Websock public path WS_PUBLIC_PATH = "/novncd/" ``` When trying to connect to NoVNC and looking a the developer console the following error appears: ``` websock.js:185 WebSocket connection to 'wss://webvirtcloud:6080//novncd/' failed: Error in connection establishment: net::ERR_CONNECTION_RESET ```
kerem closed this issue 2026-02-27 15:57:59 +03:00
Author
Owner

@mchlrv commented on GitHub (Dec 21, 2022):

This week I gave it another try after updating to the latest version. After some fiddling around I finally got it working. A bit more / better documentation would be helpful (this applies to multiple topics). Hopefully my results will help others with similar problems.

Webvirtcloud runs in docker and I'm using Apache as a reverse proxy. Below my Apache reverse proxy and websocket config.

RewriteEngine on
RewriteCond %{HTTP:Upgrade} websocket [NC]
RewriteCond %{HTTP:Connection} upgrade [NC]
RewriteRule ^/?(.*) "ws://localhost:6080/$1" [P,L]

ProxyPass /novncd/ ws://localhost:6080/novncd/ retry=3
ProxyPassReverse /novncd/ ws://locahost:6080/novncd/ retry=3

In settings.py I have configured below config for the websocket. Since I'm using SSL I've configured the WS_PUBLIC_PORT to use port 443. I also had to configure WS_PUBLIC_HOST which is the url through which Webvirtcoud is reachable.

# Websock port
WS_PORT = 6080

# Websock host
WS_HOST = "0.0.0.0"

# Websock public port - 80 or 443 if reverse-proxy, else 6080
WS_PUBLIC_PORT = 443

# Websock public host
WS_PUBLIC_HOST = "webvirtcloud.domain.tld"

# Websock public path
WS_PUBLIC_PATH = "novncd/"

Once this is all in place there is one more important step it take and that is to open up the firewall on the server running KVM. You need to open the VNC ports configured for the VM's otherwise NoVNCd can not connect.

<!-- gh-comment-id:1360989363 --> @mchlrv commented on GitHub (Dec 21, 2022): This week I gave it another try after updating to the latest version. After some fiddling around I finally got it working. A bit more / better documentation would be helpful (this applies to multiple topics). Hopefully my results will help others with similar problems. Webvirtcloud runs in docker and I'm using Apache as a reverse proxy. Below my Apache reverse proxy and websocket config. ``` RewriteEngine on RewriteCond %{HTTP:Upgrade} websocket [NC] RewriteCond %{HTTP:Connection} upgrade [NC] RewriteRule ^/?(.*) "ws://localhost:6080/$1" [P,L] ProxyPass /novncd/ ws://localhost:6080/novncd/ retry=3 ProxyPassReverse /novncd/ ws://locahost:6080/novncd/ retry=3 ``` In `settings.py` I have configured below config for the websocket. Since I'm using SSL I've configured the `WS_PUBLIC_PORT` to use port 443. I also had to configure `WS_PUBLIC_HOST` which is the url through which Webvirtcoud is reachable. ``` # Websock port WS_PORT = 6080 # Websock host WS_HOST = "0.0.0.0" # Websock public port - 80 or 443 if reverse-proxy, else 6080 WS_PUBLIC_PORT = 443 # Websock public host WS_PUBLIC_HOST = "webvirtcloud.domain.tld" # Websock public path WS_PUBLIC_PATH = "novncd/" ``` Once this is all in place there is one more important step it take and that is to open up the firewall on the server running KVM. You need to open the VNC ports configured for the VM's otherwise NoVNCd can not connect.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/webvirtcloud#254
No description provided.