Last active
July 20, 2018 08:02
-
-
Save yentsun/0a1400952817c30d6c0907d3844048ff to your computer and use it in GitHub Desktop.
Simple Nginx config with SSL
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 { | |
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