Skip to content

Instantly share code, notes, and snippets.

@correaswebert
Created January 26, 2021 18:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save correaswebert/4055e1966d071e7d7d22e32f888875f9 to your computer and use it in GitHub Desktop.
Save correaswebert/4055e1966d071e7d7d22e32f888875f9 to your computer and use it in GitHub Desktop.
A simple HTTPS enabled Nginx config.
server {
listen 80;
server_name <domain-name>;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name <domain-name>;
ssl_certificate /path/to/crt;
ssl_certificate_key /path/to/key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
location / {
proxy_pass <IP-address>;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header HOST $host;
proxy_cache_bypass $http_upgrade;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment