Nginx HTTPS with Basic Auth reverse proxy for VMware ESXi 6.5 fixed VMRC /screen
server { | |
listen 80; | |
server_name esxi.hackion.com; | |
return 301 https://$server_name$request_uri; | |
} | |
server { | |
listen 443 ssl; | |
server_name esxi.hackion.com; | |
ssl_certificate /mycert.crt | |
ssl_certificate_key /mykey.key | |
location / { | |
auth_basic "Restricted Content"; | |
auth_basic_user_file /etc/nginx/.htpasswd; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header Origin ''; | |
proxy_set_header Authorization ''; #Don't pass the Nginx Basic Auth to ESXi or it will break VMRC. | |
proxy_pass_header X-XSRF-TOKEN; | |
proxy_pass https://esxi_server; | |
proxy_send_timeout 300; | |
proxy_read_timeout 300; | |
send_timeout 300; | |
client_max_body_size 1000m; | |
# enables WS support | |
proxy_http_version 1.1; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection "upgrade"; | |
} | |
} |
This comment has been minimized.
This comment has been minimized.
Thanks Lot.. Can you share nginx conf file for Vcenter too |
This comment has been minimized.
This comment has been minimized.
Does anybody have a working version with vCenter 7.0 ? I can't make that thing work :-/ That was my working 6.X working for vCenter:
Bus as I'm new to NGINX, it a bit difficult to understand everything written above :-) |
This comment has been minimized.
This comment has been minimized.
Thanks
Thanks its works great! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
Thanks🎉