Last active
August 27, 2019 10:15
-
-
Save suru-dissanaike/5cef19a177fa8bf9dc5c66d51807c971 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 443 ssl; | |
listen [::]:443 ssl; | |
root /home/sudi/code/himinds-boosting-innovation-web-secure-cra/hn-app/build; | |
index index.html index.htm; | |
server_name MY_DOMAIN; | |
ssl_certificate /home/sudi/certbot/etc/live/MY_DOMAIN/fullchain.pem; | |
ssl_certificate_key /home/sudi/certbot/etc/live/MY_DOMAIN/privkey.pem; | |
location ~* \.(?:manifest|appcache|html?|xml|json)$ { | |
expires -1; | |
# access_log logs/static.log; # I don't usually include a static log | |
} | |
location ~* \.(?:css|js)$ { | |
try_files $uri =404; | |
expires 1y; | |
access_log off; | |
add_header Cache-Control "public"; | |
} | |
# Any route containing a file extension (e.g. /devicesfile.js) | |
location ~ ^.+\..+$ { | |
try_files $uri =404; | |
} | |
# Any route that doesn't have a file extension (e.g. /devices) | |
location / { | |
try_files $uri $uri/ /index.html; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment