This commit is contained in:
ditiqi 2025-01-27 09:12:38 +08:00
parent 9abc34c031
commit 20db2afa7c
2 changed files with 6 additions and 9 deletions

View File

@ -59,17 +59,15 @@ server {
# 文件上传处理位置
location /uploads/ {
# 文件实际存储路径
alias /data/uploads/;
# 文件传输性能优化
sendfile on;
tcp_nopush on;
# 异步IO
aio off;
aio on;
# 直接IO提高大文件传输效率
directio off;
directio 512;
# 文件访问认证
# 通过内部认证服务验证
auth_request /auth-file;
@ -78,11 +76,10 @@ server {
auth_request_set $auth_user_id $upstream_http_x_user_id;
auth_request_set $auth_resource_type $upstream_http_x_resource_type;
# 不缓存
# expires 0;
#expires 0;
# 私有缓存,禁止转换
# add_header Cache-Control "private, no-transform";
open_file_cache off; # 禁用文件缓存
add_header Cache-Control "no-cache, no-store, must-revalidate"; # 禁用浏览器缓存
add_header Cache-Control "private, no-transform";
expires -1; # 立即过期
# 添加用户和资源类型头
add_header X-User-Id $auth_user_id;

View File

@ -76,7 +76,7 @@ server {
auth_request_set $auth_user_id $upstream_http_x_user_id;
auth_request_set $auth_resource_type $upstream_http_x_resource_type;
# 不缓存
expires 0;
#expires 0;
# 私有缓存,禁止转换
add_header Cache-Control "private, no-transform";