Forked from sergey-dryabzhinsky/nginx-vhost-proxprox.conf
Created
August 1, 2017 02:49
-
-
Save Anye/8451dba8947aa87b141a9145ae8aa76f to your computer and use it in GitHub Desktop.
Nginx virtual host config for Proxmox. To hide pveproxy on 8006 port behind. With working VNC passthrough.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### | |
# 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