Skip to content

Instantly share code, notes, and snippets.

@DaanV2
Created July 11, 2023 17:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DaanV2/35a43d53ef97dd5b97ffe82e7825db91 to your computer and use it in GitHub Desktop.
Save DaanV2/35a43d53ef97dd5b97ffe82e7825db91 to your computer and use it in GitHub Desktop.
Nginx static file provider
server {
listen 80;
server_name _;
root /usr/share/nginx/html;
sendfile on;
sendfile_max_chunk 1m;
keepalive_timeout 60;
location = /healthz {
return 200;
}
location = / {
rewrite ^ /index.html last;
}
location / {
expires 24h;
add_header Cache-Control "public, must-revalidate";
add_header X-Content-Type-Options nosniff;
try_files $uri $uri/ =404;
}
autoindex on;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment