使用nginx设置filebrowser反向代理,配置文件如下:
location / {
proxy_cache off;
proxy_buffering off;
proxy_http_version 1.1;
proxy_pass http://127.0.0.1:8080;
proxy_temp_file_write_size 2048k;
# 正确设置 header
proxy_set_header Host $proxy_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Range $http_range;
proxy_set_header If-Range $http_if_range;
# 文件上传相关
client_max_body_size 4G;
client_body_buffer_size 128k;
# 超时设置
proxy_connect_timeout 60s;
proxy_read_timeout 60s;
proxy_send_timeout 60s;
# 支持分片下载
add_header Accept-Ranges bytes;
}