Last active
September 20, 2022 10:57
-
-
Save wesort/afcdfe24cb5b7783927c5e9b5e31d5c2 to your computer and use it in GitHub Desktop.
nginx.conf adjustments for Statamic deployed to Digitalocean using Laravel Forge
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
# Replace location / {...} with this: | |
location / { | |
try_files /static${uri}_${args}.html $uri /index.php?$args; | |
} | |
# Add to bottom just before closing `}`: | |
# Enable gzip compression | |
gzip on; | |
gzip_min_length 1100; | |
gzip_buffers 4 32k; | |
gzip_types text/plain application/javascript application/x-javascript text/javascript text/xml text/css; | |
gzip_vary on; | |
# Expire headers on static assets | |
# CSS and Javascript | |
# Media: images, icons, video, audio, HTC | |
location ~* \.(?:css|js|jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc|eot|ttf|woff|woff2)$ { | |
try_files $uri /index.php?$query_string; | |
expires 1y; | |
access_log off; | |
add_header Cache-Control "public"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment