Loading...

文章背景图

Openlist 保存大文件的 nginx.conf 配置

2025-12-17
0
-
- 分钟
|

在反向代理中直接修改原文

location ^~ / {
    proxy_pass http://127.0.0.1:5244; 
    proxy_set_header Host $host; 
    proxy_set_header X-Real-IP $remote_addr; 
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 
    proxy_set_header REMOTE-HOST $remote_addr; 
    proxy_set_header Upgrade $http_upgrade; 
    proxy_set_header Connection $http_connection; 
    proxy_set_header X-Forwarded-Proto $scheme; 
    proxy_set_header X-Forwarded-Port $server_port; 
    proxy_http_version 1.1; 
    add_header X-Cache $upstream_cache_status; 
    add_header Cache-Control no-cache; 
    proxy_ssl_server_name off; 
    proxy_ssl_name $proxy_host; 

    # ======== 支持5G文件上传的配置 ========
    client_max_body_size 5G;       # 最大允许5G的请求体
    proxy_connect_timeout 1800s;   # 代理连接超时30分钟
    proxy_read_timeout 1800s;      # 代理读取超时30分钟
    proxy_send_timeout 1800s;      # 代理发送超时30分钟
    client_body_timeout 1800s;     # 客户端请求体读取超时30分钟
    # ========================================
}

评论交流

文章目录