NoVNC + Nginx

schlawiner

Well-Known Member
Mar 12, 2018
40
3
48
50
Hallo,

gibt es einen Weg via Nginx NoVNC via Iframe einzubinden, den restlichen Zugriff aber zu untersagen bzw. nur auf gewissen IP`s zuzulassen? Den Nginx habe ich nach der Proxmox Anleitung installiert und konfiguriert, funktioniert ohne Probleme. Auch das einbinden des Iframe via Ticketanforderung, Ticket als User setzen usw. funktioniert.
 
von Euch hatte keiner eine Idee, da ich aber selbst etwas gebastelt habe, anbei mein Ergebnis

Code:
server {
    listen 8081;
    server_name _;
    ssl on;
    #ssl_certificate /etc/pve/local/pve-ssl.pem;
    #ssl_certificate_key /etc/pve/local/pve-ssl.key;
    ssl_certificate /etc/pve/local/pveproxy-ssl.pem;
    ssl_certificate_key /etc/pve/local/pveproxy-ssl.key;
    proxy_redirect off;
    location / {
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_pass https://localhost:8006;
        proxy_buffering off;
        client_max_body_size 0;
        proxy_connect_timeout  3600s;
        proxy_read_timeout  3600s;
        proxy_send_timeout  3600s;
        send_timeout  3600s;

location ~ /novnc/ {
        allow all;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_pass https://127.0.0.1:8006;
        proxy_buffering off;
        client_max_body_size 0;
        proxy_connect_timeout  3600s;
        proxy_read_timeout  3600s;
        proxy_send_timeout  3600s;
        send_timeout  3600s;
}
location ~ /api2/json/nodes/ {
        allow all;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_pass https://127.0.0.1:8006;
        proxy_buffering off;
        client_max_body_size 0;
        proxy_connect_timeout  3600s;
        proxy_read_timeout  3600s;
        proxy_send_timeout  3600s;
        send_timeout  3600s;
}

if ( $args !~ "/?console=([a-z]+)&novnc=([0-9]+)&vmid=([0-9]+)&node=([0-9A-Za-z-.]+)&resize=([a-z]+)") {
return 403;
}

}
 
  • Like
Reactions: Kolovatoff1

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!