Created
February 14, 2021 15:20
-
-
Save jaclu010/92709418bcd18a5dc4a885ce3608d7d8 to your computer and use it in GitHub Desktop.
Proxy to expose HA-setup
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
map $http_upgrade $connection_upgrade { | |
default upgrade; | |
'' close; | |
} | |
server { | |
server_name your.server.com; | |
# These shouldn't need to be changed | |
listen [::]:80 default_server ipv6only=off; | |
return 301 https://$host$request_uri; | |
} | |
server { | |
listen 443 ssl; | |
listen [::]:443 default_server ssl http2 ipv6only=on; | |
server_name your.server.com; | |
ssl_certificate path/to/fullchain.pem; # managed by Certbot | |
ssl_certificate_key path/to/privkey.pem; # managed by Certbot | |
include path/to/options-ssl-nginx.conf; # managed by Certbot | |
ssl_dhparam path/to/ssl-dhparams.pem; # managed by Certbot | |
add_header Strict-Transport-Security "max-age=31536000; includeSubdomains"; | |
access_log /var/log/nginx/haproxy.access.log; | |
proxy_buffering off; | |
location / { | |
proxy_pass http://127.0.0.1:8123; | |
proxy_set_header Host $host; | |
proxy_redirect http:// https://; | |
proxy_http_version 1.1; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection $connection_upgrade; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-Proto $scheme; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment