Last active
March 30, 2023 16:45
-
-
Save vasyakrg/899607b4739bacb8801f3fd6951e5c83 to your computer and use it in GitHub Desktop.
nginx load balance for proxmox
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
| upstream proxmox { | |
| server pve1:8006; | |
| server pve2:8006; | |
| server pve3:8006; | |
| } | |
| server { | |
| listen 80 default_server; | |
| rewrite ^(.*) https://$host$1 permanent; | |
| } | |
| server { | |
| listen 443; | |
| server_name server_name; # you external server name | |
| ssl on; | |
| ssl_certificate /etc/nginx/ssl/cert.pem; # you cert fot external domain | |
| ssl_certificate_key /etc/nginx/ssl/key.pem; # you key for external domain | |
| proxy_redirect off; | |
| location / { | |
| proxy_http_version 1.1; | |
| proxy_set_header Connection $http_connection; | |
| proxy_set_header Origin http://$host; | |
| proxy_set_header Upgrade $http_upgrade; | |
| proxy_pass https://proxmox; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment