上传大文件遇到504超时错误
注意在百度,百度什么504超时,一大堆,都不能解决问题,
翻墙搜索一下英文,一下子就找到答案了,
Timeout when uploading a large file?
在nginx配置文件:
proxy_read_timeout 1200;
nging.conf
user nobody nobody;
worker_processes 8;
worker_cpu_affinity 0001 0010 0100 1000 0001 0010 0100 0001;
worker_rlimit_nofile 10240;
pid logs/nginx.pid;
events {
use epoll;
worker_connections 10240;
}
http {
include mime.types;
default_type text/html;
#log_format main '$remote_addr - $remote_user [$time_local] $request '
# '"$status" $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
log_format hits '$uri;$remote_addr';
log_format main 'http://$host$uri;$remote_addr';
log_format referer 'http://$host$uri;$http_referer;$http_x_forwarded_for';
log_format access '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" $http_x_forwarded_for';
log_format player_main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
log_format main_st '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log logs/access.log main;
keepalive_timeout 1000;
proxy_read_timeout 1200;
gzip on;
gzip_min_length 1024;
gzip_buffers 4 8k;
gzip_types text/* application/javascript application/x-javascript text/css text/plain;
gzip_http_version 1.0;
gzip_comp_level 9;
gzip_proxied any;
gzip_vary on;
#output_buffers 1 32k;
#postpone_output 1460;
client_header_timeout 60m;
client_body_timeout 60m;
send_timeout 60m;
sendfile on;
tcp_nopush on;
tcp_nodelay off;
client_header_buffer_size 256k;
large_client_header_buffers 2 256k;
server_names_hash_bucket_size 256;
charset UTF-8;
#默认域名(不能访问)
include upstream.conf;
include servers/*.com;
include servers/*.net;
include servers/*.org;
include servers/*.cn;
include servers/*.in;
include servers/*.tw;
}