Created
July 11, 2023 17:09
-
-
Save DaanV2/35a43d53ef97dd5b97ffe82e7825db91 to your computer and use it in GitHub Desktop.
Nginx static file provider
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
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