Skip to content

Instantly share code, notes, and snippets.

@mikeckennedy
Created February 13, 2026 15:30
Show Gist options
  • Select an option

  • Save mikeckennedy/f03686c4c4ce7ce88b41c6b91c3226cf to your computer and use it in GitHub Desktop.

Select an option

Save mikeckennedy/f03686c4c4ce7ce88b41c6b91c3226cf to your computer and use it in GitHub Desktop.
Example NGINX config for https://mkennedy.codes
server {
listen 80;
server_name mkennedy.codes;
charset utf-8;
server_tokens off;
root /apps/static/mkennedy.codes/mkblog/mksite/public-prod;
index index.html;
# To allow for Let's Encrypt
location /.well-known/acme-challenge/ {
root /var/www/certbot;
}
location ~* .(html)$ {
expires 2m;
add_header Cache-Control "private";
add_header Cache-Control "max-age=120"; # set cache timeout to 2 min for pages
}
location ~* .(png|webp|ico|gif|jpg|jpeg|css|js)$ {
expires 1h;
add_header Cache-Control "public";
add_header Cache-Control "max-age=3600"; # set cache timeout to 1 hour
}
gzip on;
gzip_comp_level 6;
gzip_min_length 1100;
gzip_buffers 16 8k;
gzip_proxied any;
gzip_types
text/plain
text/xml
text/css
text/markdown
application/javascript
application/json
application/xml
application/rss+xml;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment