reverse proxy nginx noVNC problem since V5

Discussion in 'Proxmox VE: Installation and configuration' started by gottlieb, Jul 12, 2017.

  1. gottlieb

    gottlieb New Member

    Joined:
    Jul 12, 2017
    Messages:
    1
    Likes Received:
    0
    hello,

    i have a problem when i want use noVNC console from my reverse proxy nginx
    when i was on proxmox 4, i havent problem, now on proxmox 5 with new console features
    i have a black screen on console, he said me connected (encrypted ) on QEMU, but i can nothing
    on my local network with IP of proxmox, its work

    my nginx config in attach


    have you a idea?
    thanks
     

    Attached Files:

  2. Sunit Kumar Nandi

    Sunit Kumar Nandi New Member

    Joined:
    Jul 15, 2017
    Messages:
    2
    Likes Received:
    0
    I am facing the same issue. Proxying via nginx results in a blank screen in noVNC while direct connections to port 8006 works as intended.
     
  3. warinthestars

    warinthestars New Member

    Joined:
    Sep 6, 2015
    Messages:
    11
    Likes Received:
    0
    I am having the same problem. I've tried may different configs and so far nothing has worked.
     
  4. warinthestars

    warinthestars New Member

    Joined:
    Sep 6, 2015
    Messages:
    11
    Likes Received:
    0
    So, i'm no longer getting a blank screen when trying to connect to console. However, it's still not 100% working all the time. Here's an example of my config

    map $http_upgrade $connection_upgrade {
    default upgrade;
    '' close;
    }
    upstream proxmox {
    server 192.168.1.5;
    }

    server {
    listen 80;
    rewrite ^(.*) https://DOMAIN.NET permanent;
    }

    server {
    listen 443 ssl;
    server_name PROXMOX.DOMAIN.NET;
    ssl on;
    include snippets/ssl-default.conf;
    include snippets/ssl-params.conf;
    client_max_body_size 5g;
    proxy_read_timeout 3000s;
    proxy_send_timeout 3000s;


    location / {
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

    # Also proxy websocket
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    add_header X-Frame-Options SAMEORIGIN;

    # proxy backend
    proxy_pass https://192.168.1.50:8006/;
    }
    }
     
  5. b3nw

    b3nw New Member
    Proxmox VE Subscriber

    Joined:
    Jul 21, 2017
    Messages:
    9
    Likes Received:
    0
  6. psmitty7373

    psmitty7373 New Member

    Joined:
    Aug 1, 2017
    Messages:
    2
    Likes Received:
    0
    Same issue. For what its worth I've tried reverse proxying with haproxy also only to have the same issue. Black screens on consoles about 60% of the time.
     
  7. warinthestars

    warinthestars New Member

    Joined:
    Sep 6, 2015
    Messages:
    11
    Likes Received:
    0
    I was able to use chrome dev menu to debug a bit.

    Adding this line: add_header X-Frame-Options SAMEORIGIN;
    stopped a blank screen and started allowing it sometimes. Sometimes it worked with the inline console, sometimes it worked with the pop out window console.

    It will still say it's connected and encrypted, but stays blank.
     
  8. Nayar

    Nayar New Member

    Joined:
    Sep 26, 2017
    Messages:
    5
    Likes Received:
    0
    I'm having the same issue. Anyone found a solution?

    Works randomly for me.
     
  9. GabrieleV

    GabrieleV New Member

    Joined:
    May 20, 2013
    Messages:
    10
    Likes Received:
    0
    Same problem ...
     
  10. mir

    mir Well-Known Member
    Proxmox VE Subscriber

    Joined:
    Apr 14, 2012
    Messages:
    3,418
    Likes Received:
    87
    The solution to your problems is to enable sticky sessions. Your problem is that your novnc some times makes connection to another node than the one you are currently connected to.
     
  11. GabrieleV

    GabrieleV New Member

    Joined:
    May 20, 2013
    Messages:
    10
    Likes Received:
    0
    I have only one node, and I have the same problem :(
     
  12. b3nw

    b3nw New Member
    Proxmox VE Subscriber

    Joined:
    Jul 21, 2017
    Messages:
    9
    Likes Received:
    0
    @mir can you expand on how to enable sticky sessions?
     
  13. mir

    mir Well-Known Member
    Proxmox VE Subscriber

    Joined:
    Apr 14, 2012
    Messages:
    3,418
    Likes Received:
    87
  14. janos

    janos Member

    Joined:
    Aug 24, 2017
    Messages:
    54
    Likes Received:
    4
    I can reproducate this also. However, its not happening everytime, but i not see any system in it.

    Usually if i press F5 on noVNC windows it start working, but not always.

    Config: https://pastebin.com/xZDZpLXJ
     
  15. Nayar

    Nayar New Member

    Joined:
    Sep 26, 2017
    Messages:
    5
    Likes Received:
    0
    Anyways, you guys can also do TCP forwarding like this which works fine

    stream {
    server {
    listen 8006;
    proxy_pass 192.168.1.65:8006;
    }
    }​

    But we lose the advanced HTTP ACL features :(
     
  16. aychprox

    aychprox Member

    Joined:
    Oct 27, 2015
    Messages:
    56
    Likes Received:
    3
    since current noVNC version in PVE5.1 not work well, possible to downgrade to previous version?
    ip_hash nginx work fine for noVNC in PVE4.4.
     
  17. mir

    mir Well-Known Member
    Proxmox VE Subscriber

    Joined:
    Apr 14, 2012
    Messages:
    3,418
    Likes Received:
    87
    The article misses this in the 'location / { ..' section: add_header X-Frame-Options SAMEORIGIN;
     
  18. Amin Vakil

    Amin Vakil New Member

    Joined:
    Nov 21, 2017
    Messages:
    4
    Likes Received:
    0
    I changed it to be like this:
    location / { ...
    .
    .
    .
    add_header X-Frame-Options SAMEORIGIN;
    }
    Still doesn't work, Am I missing something?
    I can verify adding this on my firefox (view image)
    As I'm new to forum I can't post my image.
    View this link: aminvakil.com/proxmox/1.png
     
  19. mir

    mir Well-Known Member
    Proxmox VE Subscriber

    Joined:
    Apr 14, 2012
    Messages:
    3,418
    Likes Received:
    87
    Hard to help you without access to the contents of the proper log files. Try run you preferred browser in web developer mode and see what is showing in the console window.
     
  20. Amin Vakil

    Amin Vakil New Member

    Joined:
    Nov 21, 2017
    Messages:
    4
    Likes Received:
    0
    I use firefox and I checked network tab of developers options, and the only sent headers when connecting to vnc websocket different from using IP itself which works novnc on it is Host & Origin.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice