Friday, October 2, 2015

Proxmox V4 Nginx Reverse Proxy with VNC

After many many fails now a working one. This is for https://domain.tld/proxmox:

 location ~ ^/(?:proxmox|pve2|api2|novnc)$ {
    rewrite /(proxmox|pve2|api2|novnc) /$1/ permanent;
  }
  location ~ ^/(?:proxmox|pve2|api2|novnc)/ {
    rewrite /proxmox/(.*) /$1 break;
    rewrite /((?:pve2|api2|novnc)/.*) /$1 break;
    proxy_pass https://xxx.xxx.xxx.xxx:8006;
    proxy_read_timeout 90;
    proxy_redirect off;
    proxy_http_version 1.1;
    proxy_set_header Connection "upgrade";
    proxy_set_header Origin http://$host;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
  }

1 comment: