diff --git a/config/nginx/conf.d/web.conf b/config/nginx/conf.d/web.conf index 010c95d..0bc595c 100644 --- a/config/nginx/conf.d/web.conf +++ b/config/nginx/conf.d/web.conf @@ -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; diff --git a/config/nginx/conf.d/web.template b/config/nginx/conf.d/web.template index 2ffdfe8..1d8bb4a 100644 --- a/config/nginx/conf.d/web.template +++ b/config/nginx/conf.d/web.template @@ -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";