fix: nginx cache (#1523)

This commit is contained in:
ChengLei Shao 2023-03-03 13:10:47 +08:00 committed by GitHub
parent 1a84396691
commit 04971c3824
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,10 +6,18 @@ server {
client_max_body_size 20M;
gzip on;
gzip_vary on;
gzip_min_length 1024;
gzip_proxied expired no-cache no-store private auth;
gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/javascript application/xml;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
# 不缓存 HTML 文件
location ~ \.html$ {
expires -1;
}
# 缓存 JavaScript 和 CSS 文件
location ~* \.(js|css)$ {
expires 1d;
add_header Cache-Control "public";
}
location /storage/uploads/ {
alias /app/nocobase/storage/uploads/;