novnc / noVNC

VNC client web application
https://novnc.com
Other
11.65k stars 2.31k forks source link

assigning domain to noVNC port #1894

Closed bhaktatejas922 closed 2 months ago

bhaktatejas922 commented 2 months ago

trying to assign a domain to novnc but just get a generic Failed to connect error (html loads but cant connect)

using the underlying correct IP :port to go to it does not work either

ex nginx: events { worker_connections 1024; }

http { server { listen 80; server_name vnc.domain.com;

    location / {
        return 301 https://$host$request_uri;
    }
}

server {
    listen 443 ssl;
    server_name vnc.pinpoint.com;
    ssl_certificate /etc/letsencrypt/live/vnc.domain.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/vnc.domain.com/privkey.pem;
    location / {
        proxy_pass http://localhost:6080;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

}%

1) Is there a way to get error logs somehow to debug issues? 2) Whats happening here? ` ./utils/novnc_proxy --vnc localhost:5900 --listen localhost:6080

Warning: could not find self.pem Using local websockify at /Users/***** Starting webserver and WebSockets proxy on host localhost port 6080 WebSocket server settings:

bhaktatejas922 commented 2 months ago

Solved: domain output url host and port are used in the websocket call (which is whats failing when we see Failed to connect)

just modify the params in the url such that you're hitting wherever your websockify is and it'll work.