forked from nutomic/joinpeertube
long browser caching for everything except text/html (fixes #16)
This commit is contained in:
parent
6d86424107
commit
1f6fc82de1
1 changed files with 8 additions and 3 deletions
|
@ -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";
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue