Created
January 20, 2021 15:34
-
-
Save quantenProjects/355ec07cc49ef84f233c81b072509dd9 to your computer and use it in GitHub Desktop.
nginx openslides reverse proxy configuration TLS
This file contains 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
server { | |
access_log off; | |
listen 80 default_server; | |
listen [::]:80 default_server; | |
# enforce https | |
return 301 https://$host$request_uri; | |
} | |
server { | |
access_log off; | |
listen 443 ssl http2; | |
listen [::]:443 ssl http2; | |
server_name <DOMAINNAME>; | |
ssl_certificate /etc/letsencrypt/live/<DOMAINNAME>/fullchain.pem; | |
ssl_certificate_key /etc/letsencrypt/live/<DOMAINNAME>/privkey.pem; | |
# intermediate configuration | |
ssl_protocols TLSv1.2 TLSv1.3; | |
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384; | |
ssl_prefer_server_ciphers off; | |
client_max_body_size 128M; | |
location /ws/ { | |
proxy_pass http://127.0.0.1:8000; | |
proxy_http_version 1.1; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection "Upgrade"; | |
proxy_set_header Host $host; | |
} | |
location / { | |
proxy_pass_header Server; | |
proxy_set_header Host $http_host; | |
proxy_redirect off; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Scheme $scheme; | |
proxy_pass http://127.0.0.1:8000/; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment