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