[GH-ISSUE #216] Traefik and docker-compose #142

Open
opened 2026-02-27 15:57:29 +03:00 by kerem · 4 comments
Owner

Originally created by @Cybernemo on GitHub (Jan 15, 2019).
Original GitHub issue: https://github.com/retspen/webvirtcloud/issues/216

Hello,
I am using webvirtcloud with the reverse proxy Traefik and docker-compose.
Here is my docker-compose.yml:

webvirtcloud:
    container_name: webvirtcloud  
    image: mplx/docker-webvirtcloud
    ports:
      - "8087:80"
    environment:
      - VNC_PORT=8087
      - VIRTUAL_HOST=MYDOMAIN.COM
      - VIRTUAL_PORT=80
      - LETSENCRYPT_HOST=MYDOMAIN.COM
      - LETSENCRYPT_EMAIL=MYEMAIL@MAIL.COM
    labels:
        - traefik.backend=webvirtcloud
        - traefik.frontend.rule=Host:MYDOMAIN.COM
        - traefik.docker.network=proxy
        - traefik.port=80
        - traefik.enable=true
    volumes:
      - /srv/webvirtcloud/data:/srv/webvirtcloud/data
      - /srv/webvirtcloud/ssh:/var/www/.ssh
    networks:
      - traefik

I can login and create instances but noVNC is not working neither is an instance details (error 500).

Originally created by @Cybernemo on GitHub (Jan 15, 2019). Original GitHub issue: https://github.com/retspen/webvirtcloud/issues/216 Hello, I am using webvirtcloud with the reverse proxy Traefik and docker-compose. Here is my docker-compose.yml: ``` webvirtcloud: container_name: webvirtcloud image: mplx/docker-webvirtcloud ports: - "8087:80" environment: - VNC_PORT=8087 - VIRTUAL_HOST=MYDOMAIN.COM - VIRTUAL_PORT=80 - LETSENCRYPT_HOST=MYDOMAIN.COM - LETSENCRYPT_EMAIL=MYEMAIL@MAIL.COM labels: - traefik.backend=webvirtcloud - traefik.frontend.rule=Host:MYDOMAIN.COM - traefik.docker.network=proxy - traefik.port=80 - traefik.enable=true volumes: - /srv/webvirtcloud/data:/srv/webvirtcloud/data - /srv/webvirtcloud/ssh:/var/www/.ssh networks: - traefik ``` I can login and create instances but noVNC is not working neither is an instance details (error 500).
Author
Owner

@catborise commented on GitHub (Jan 16, 2019):

i do not know traefik but you should redirect vnc ports also. VNC ports starts 5900-5999(it depends vm count).

<!-- gh-comment-id:454663623 --> @catborise commented on GitHub (Jan 16, 2019): i do not know traefik but you should redirect vnc ports also. VNC ports starts 5900-5999(it depends vm count).
Author
Owner

@lord-kyron commented on GitHub (Jan 16, 2019):

@Cybernemo - if you want to use the VNC and for reverse proxy you are using NGINX, I can give you my config which I am using and it is working.
There are several files, which needs to be edited additionally, but there not so hard to edit.

<!-- gh-comment-id:454692750 --> @lord-kyron commented on GitHub (Jan 16, 2019): @Cybernemo - if you want to use the VNC and for reverse proxy you are using NGINX, I can give you my config which I am using and it is working. There are several files, which needs to be edited additionally, but there not so hard to edit.
Author
Owner

@Cybernemo commented on GitHub (Jan 18, 2019):

@Bandic007 that would be great!

<!-- gh-comment-id:455435408 --> @Cybernemo commented on GitHub (Jan 18, 2019): @Bandic007 that would be great!
Author
Owner

@lord-kyron commented on GitHub (Jan 18, 2019):

@Cybernemo - here is the repo - it includes the latest changes from @catborise + reverse proxy nginx support:
https://github.com/Bandic007/webvirtcloud-plus.git

Inside settings.py file there just severl lines that you have to modify according to your needs:
WS_PUBLIC_HOST
WS_PUBLIC_PORT
WS_CERT

Here is the nginx config for the reverse proxy:
`server {
listen 443;

server_name DOMAIN_NAME_HERE;
access_log /var/log/nginx/ssl_webvirtcloud_access_log;

ssl_certificate PATH_TO_SSL_CERT;
ssl_certificate_key PATH_TO_SSL_KEY;

location /static/ {
    root /srv/webvirtcloud;
    expires max;
} 

location / {
proxy_pass http://127.0.0.1:8000;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-for $proxy_add_x_forwarded_for;
    proxy_set_header Host $host:$server_port;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_connect_timeout 1200;
    proxy_read_timeout 1200;
    proxy_send_timeout 1200;
    client_max_body_size 1024M; # Set higher depending on your needs
}

location /novncd/ {
    proxy_pass http://wsnovncd;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
proxy_read_timeout 61s;
proxy_buffering off;
}

}

upstream wsnovncd {
server 127.0.0.1:6080;
}`

However, keep in mind, that I am not using the docker_compose.yaml file, so maybe some changes needed to be done there, but when you see my changes, you will be able to figure it out. :)

<!-- gh-comment-id:455474979 --> @lord-kyron commented on GitHub (Jan 18, 2019): @Cybernemo - here is the repo - it includes the latest changes from @catborise + reverse proxy nginx support: https://github.com/Bandic007/webvirtcloud-plus.git Inside settings.py file there just severl lines that you have to modify according to your needs: WS_PUBLIC_HOST WS_PUBLIC_PORT WS_CERT Here is the nginx config for the reverse proxy: `server { listen 443; server_name DOMAIN_NAME_HERE; access_log /var/log/nginx/ssl_webvirtcloud_access_log; ssl_certificate PATH_TO_SSL_CERT; ssl_certificate_key PATH_TO_SSL_KEY; location /static/ { root /srv/webvirtcloud; expires max; } location / { proxy_pass http://127.0.0.1:8000; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-for $proxy_add_x_forwarded_for; proxy_set_header Host $host:$server_port; proxy_set_header X-Forwarded-Proto $scheme; proxy_connect_timeout 1200; proxy_read_timeout 1200; proxy_send_timeout 1200; client_max_body_size 1024M; # Set higher depending on your needs } location /novncd/ { proxy_pass http://wsnovncd; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_read_timeout 61s; proxy_buffering off; } } upstream wsnovncd { server 127.0.0.1:6080; }` However, keep in mind, that I am not using the docker_compose.yaml file, so maybe some changes needed to be done there, but when you see my changes, you will be able to figure it out. :)
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#142
No description provided.