Created
May 8, 2019 08:57
-
-
Save manjeshpv/7d2bf2808d244fd64b6176812b99807c to your computer and use it in GitHub Desktop.
nginx config for angular-fullstack
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
# cache directive for all static apps | |
index index.html; | |
# cache.appcache, your document html and data | |
location ~* \.(?:manifest|appcache|html?|xml|json)$ { | |
expires -1; | |
} | |
# Media: images, icons, video, audio, HTC | |
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|eot|otf|woff|woff2|ttf|svg|svgz|mp4|ogg|ogv|webm|htc)$ { | |
expires 1M; | |
access_log off; | |
add_header Cache-Control "public"; | |
} | |
# CSS and Javascript | |
location ~* \.(?:css|js)$ { | |
expires 1y; | |
access_log off; | |
add_header Cache-Control "public"; | |
} | |
location / { | |
#if ($args !~* _v=110917) { | |
# return 301 https://$server_name$uri?_v=110917&$args; | |
#} | |
try_files $uri $uri/ /index.html; | |
expires -1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sudo nano /etc/nginx/gzip