Skip to content

Instantly share code, notes, and snippets.

@yentsun
Last active July 20, 2018 08:02
Show Gist options
  • Save yentsun/0a1400952817c30d6c0907d3844048ff to your computer and use it in GitHub Desktop.
Save yentsun/0a1400952817c30d6c0907d3844048ff to your computer and use it in GitHub Desktop.
Simple Nginx config with SSL
server {
listen 80;
listen [::]:80;
server_name .example.com;
return 301 https://example.com;
}
server {
listen 443 ssl;
listen [::]:443 ssl;
ssl_certificate /home/user/example.com/example.com.crt;
ssl_certificate_key /home/user/example.com/example.com.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers "HIGH:!RC4:!aNULL:!MD5:!kEDH";
add_header Strict-Transport-Security 'max-age=604800';
server_name example.com;
location / {
root /home/user/example.com/app/build;
index index.html;
}
location /api {
rewrite /api/(.*) /$1 break;
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