You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
72 lines
2.1 KiB
72 lines
2.1 KiB
#user nobody;
|
|
worker_processes auto;
|
|
|
|
events {
|
|
worker_connections 1024;
|
|
}
|
|
|
|
daemon off;
|
|
|
|
http {
|
|
include mime.types;
|
|
default_type application/octet-stream;
|
|
sendfile on;
|
|
#tcp_nopush on;
|
|
keepalive_timeout 65;
|
|
gzip on;
|
|
client_body_temp_path ./;
|
|
client_max_body_size 0;
|
|
client_header_timeout 36000s;
|
|
client_body_timeout 36000s;
|
|
fastcgi_connect_timeout 36000s;
|
|
fastcgi_send_timeout 36000s;
|
|
fastcgi_read_timeout 36000s;
|
|
|
|
# proxy 相关设置
|
|
proxy_read_timeout 36000s; # 代理读取超时时间
|
|
proxy_send_timeout 36000s; # 代理发送超时时间
|
|
proxy_connect_timeout 36000s; # 代理连接超时时间
|
|
# 调整缓冲区设置
|
|
proxy_buffer_size 256k; # 为每个代理请求分配缓冲区大小
|
|
proxy_buffers 4 512k; # 设置代理响应的缓冲区大小
|
|
proxy_busy_buffers_size 512k; # 设置代理忙碌时的缓冲区大小
|
|
proxy_temp_file_write_size 512k; # 设置临时文件的写入大小
|
|
|
|
|
|
upstream file_xtcp {
|
|
# 轮询分发
|
|
server 127.0.0.1:9090;
|
|
server 127.0.0.1:8082;
|
|
server 127.0.0.1:8083;
|
|
server 127.0.0.1:8084;
|
|
server 127.0.0.1:8085;
|
|
server 127.0.0.1:8086;
|
|
server 127.0.0.1:8087;
|
|
server 127.0.0.1:9091;
|
|
}
|
|
|
|
server {
|
|
listen 8088;
|
|
server_name localhost;
|
|
charset utf-8;
|
|
|
|
location / {
|
|
proxy_pass http://file_xtcp/;
|
|
proxy_redirect off;
|
|
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;
|
|
|
|
# 调整上传时的连接超时和缓冲设置
|
|
client_max_body_size 100G; # 如果文件大于此限制,上传会失败
|
|
client_body_timeout 360000s; # 上传数据的最大超时时间
|
|
send_timeout 3600s; # 响应超时
|
|
}
|
|
|
|
error_page 500 502 503 504 /50x.html;
|
|
location = /50x.html {
|
|
root html;
|
|
}
|
|
}
|
|
}
|
|
|