Skip to content

Instantly share code, notes, and snippets.

@wesort
Last active May 8, 2025 21:52
Show Gist options
  • Save wesort/afcdfe24cb5b7783927c5e9b5e31d5c2 to your computer and use it in GitHub Desktop.
Save wesort/afcdfe24cb5b7783927c5e9b5e31d5c2 to your computer and use it in GitHub Desktop.
nginx.conf adjustments for Statamic +v3 deployed to Digitalocean using Laravel Forge
# 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