Skip to content

Instantly share code, notes, and snippets.

@shijiezhou1
Created March 6, 2020 03:39
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 shijiezhou1/ef63e8a709eb41c9a156263204629408 to your computer and use it in GitHub Desktop.
Save shijiezhou1/ef63e8a709eb41c9a156263204629408 to your computer and use it in GitHub Desktop.
Setting up Ubuntu config file in Nginx with SSL
#
server {
listen 80;
listen [::]:80;
server_name yourdomainname.com www.yourdomainname.com;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;
server_name yourdomainname.com www.yourdomainname.com;
location / {
proxy_pass http://localhost:3000;
}
ssl_certificate /etc/letsencrypt/live/yourdomainname.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/yourdomainname.com/privkey.pem;
ssl_session_timeout 1h;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
add_header Strict-Transport-Security “max-age=15768000” always;
ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
}
#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment