Created
February 13, 2026 15:30
-
-
Save mikeckennedy/f03686c4c4ce7ce88b41c6b91c3226cf to your computer and use it in GitHub Desktop.
Example NGINX config for https://mkennedy.codes
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 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