Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Nginx virtual host config for Proxmox. To hide pveproxy on 8006 port behind. With working VNC passthrough.
###
# Nginx vhost file to hide Proxmox pveproxy
# For 3.4+ version, maybe older too.
#
# Do not forget to create file
# /etc/default/pveproxy:
# ALLOW_FROM="127.0.0.1"
# DENY_FROM="all"
# POLICY="allow"
#
server {
# nginx-1.0+
#listen 443 ssl;
# nginx-1.6+
listen 443 ssl spdy;
# nginx-1.10+
#listen 443 ssl http2;
root /var/www/default;
server_name proxmox.example.com;
valid_referers none blocked server_names;
if ($invalid_referer) {
return 403;
}
access_log /var/log/nginx/proxmox.example.com-ssl-access.log;
error_log /var/log/nginx/proxmox.example.com-ssl-error.log;
# load images, backups, iso...
client_max_body_size 1024m;
include proxy_params;
include ssl/proxmox.conf;
location / {
# Magick for VNC
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass https://127.0.0.1:8006;
}
# MAGICK !!!
# Proxmox Web-UI loads DEBUG version of ExtJS
# And nginx waaaaaing sooo long. And hangs.
# Do not proxy static files, just give them
location ~* ^/pve2/(?<file>.*)$ {
root /usr/share/pve-manager;
try_files /$file @proxmox;
}
location @proxmox {
# Magick for VNC
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass https://127.0.0.1:8006;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.