long browser caching for everything except text/html (fixes #16)

This commit is contained in:
Felix 2020-02-15 17:54:08 +01:00
parent 6d86424107
commit 1f6fc82de1

View file

@ -14,6 +14,13 @@ http {
access_log /var/log/nginx/access.log main;
sendfile on;
keepalive_timeout 65;
# Expires map
map $sent_http_content_type $expires {
default 30d;
text/html 2h;
}
server {
listen 80;
server_name localhost;
@ -21,13 +28,11 @@ http {
# Hide nginx version
server_tokens off;
# TODO: maybe setup cache as well
location / {
root /app;
index index.html;
try_files $uri $uri/ /index.html;
expires 1d;
expires $expires;
add_header Pragma public;
add_header Cache-Control "public";
}