http504超时错误通过nginx配置处理

上传大文件遇到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;

}


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值