mirror of
https://github.com/penpot/penpot.git
synced 2025-01-08 16:00:19 -05:00
🐛 Fix cache issues on devevn nginx config
This commit is contained in:
parent
b80469c040
commit
e998ec7c2d
1 changed files with 35 additions and 25 deletions
|
@ -92,34 +92,13 @@ http {
|
|||
error_page 301 302 307 = @handle_redirect;
|
||||
}
|
||||
|
||||
location /internal/gfonts/css {
|
||||
proxy_pass https://fonts.googleapis.com/css?$args;
|
||||
proxy_hide_header Access-Control-Allow-Origin;
|
||||
proxy_hide_header Cross-Origin-Resource-Policy;
|
||||
proxy_hide_header Link;
|
||||
proxy_hide_header Alt-Svc;
|
||||
proxy_hide_header Cache-Control;
|
||||
proxy_hide_header Expires;
|
||||
|
||||
proxy_ignore_headers Set-Cookie Vary Cache-Control Expires;
|
||||
|
||||
proxy_set_header User-Agent "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36";
|
||||
proxy_set_header Host "fonts.googleapis.com";
|
||||
proxy_set_header Accept "*/*";
|
||||
|
||||
proxy_cache penpot;
|
||||
|
||||
add_header Access-Control-Allow-Origin $http_origin;
|
||||
add_header Cache-Control max-age=86400;
|
||||
add_header X-Cache-Status $upstream_cache_status;
|
||||
}
|
||||
|
||||
location /internal/assets {
|
||||
internal;
|
||||
alias /home/penpot/penpot/backend/assets;
|
||||
add_header x-internal-redirect "$upstream_http_x_accel_redirect";
|
||||
}
|
||||
|
||||
# On production, this is controlled by ELB
|
||||
location /api/export {
|
||||
proxy_pass http://127.0.0.1:6061;
|
||||
}
|
||||
|
@ -192,6 +171,38 @@ http {
|
|||
add_header X-Cache-Status $upstream_cache_status;
|
||||
}
|
||||
|
||||
location ~ ^/internal/gfonts/css {
|
||||
proxy_pass https://fonts.googleapis.com/css?$args;
|
||||
proxy_hide_header Access-Control-Allow-Origin;
|
||||
proxy_hide_header Cross-Origin-Resource-Policy;
|
||||
proxy_hide_header Link;
|
||||
proxy_hide_header Alt-Svc;
|
||||
proxy_hide_header Cache-Control;
|
||||
proxy_hide_header Expires;
|
||||
|
||||
proxy_ignore_headers Set-Cookie Vary Cache-Control Expires;
|
||||
|
||||
proxy_set_header User-Agent "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36";
|
||||
proxy_set_header Host "fonts.googleapis.com";
|
||||
proxy_set_header Accept "*/*";
|
||||
|
||||
proxy_cache penpot;
|
||||
|
||||
add_header Access-Control-Allow-Origin $http_origin;
|
||||
add_header Cache-Control max-age=86400;
|
||||
add_header X-Cache-Status $upstream_cache_status;
|
||||
}
|
||||
|
||||
location ~ ^/js/config.js$ {
|
||||
add_header Cache-Control "no-store, no-cache, max-age=0" always;
|
||||
}
|
||||
|
||||
location ~* \.(js|css|jpg|svg|png)$ {
|
||||
# We set no cache only on devenv
|
||||
add_header Cache-Control "no-store, no-cache, max-age=0" always;
|
||||
# add_header Cache-Control "max-age=604800" always; # 7 days
|
||||
}
|
||||
|
||||
location ~ ^/(/|css|fonts|images|js|wasm) {
|
||||
}
|
||||
|
||||
|
@ -200,9 +211,8 @@ http {
|
|||
}
|
||||
|
||||
add_header Last-Modified $date_gmt;
|
||||
add_header Cache-Control 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
|
||||
add_header Cache-Control "no-store, no-cache, max-age=0" always;
|
||||
if_modified_since off;
|
||||
expires off;
|
||||
try_files $uri /index.html$is_args$args =404;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue