使用Nginx做代理的时候,下载文件偶尔会出现错误,试了多中方法扔没有方法解决

错误代码如下:

2018/04/22 16:06:06 [error] 7228#6412: *1 WSARecv() failed (10054: An existing connection was forcibly closed by the remote host)
 while reading upstream, client: 192.168.19.109, server: 192.168.19.104, request: "GET /jtbc/queryMessage_export HTTP/1.1", 
upstream: "http://192.168.19.104:8080/jtbc/queryMessage_export", host: "192.168.19.104:18080", 
referrer: "http://192.168.19.104:18080/path?path=jtbb_jtbcl"
worker_processes  1;
 
events {
    worker_connections  4096;
}


http {
    include       mime.types;
    default_type  application/octet-stream;
 
    sendfile        on;
	
    keepalive_requests 500;
    proxy_http_version 1.1;


    keepalive_timeout  65;
    upstream backend{ 
	  server 192.168.19.104:8080 weight=10 max_fails=5 fail_timeout=10s;
	  server 192.168.19.104:28080 weight=10 max_fails=5 fail_timeout=10s;
    }  


    gzip  off;
	
	tcp_nodelay        on;
	
    server {
        listen       18080;
        server_name  192.168.19.104;
	error_log 	logs/error.log info;
        access_log  logs/host.access.log;
	keepalive_timeout 65;
	keepalive_requests 500;
	proxy_http_version 1.1;
	 
        location / {  
			root   html;  
			index  index.html index.htm;  
			proxy_pass http://backend;
			proxy_set_header Host $host:18080;
			proxy_set_header X-Real-IP $remote_addr;
			proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
			proxy_connect_timeout 20;
			proxy_send_timeout 30;
			proxy_read_timeout 30;
			proxy_buffering off;
			keepalive_timeout 65;
			keepalive_requests 500;
			proxy_http_version 1.1;
		} 

		error_page   500 502 503 504  /50x.html;
		location = /50x.html {
            root   html;
        }
    }
}

 

你可能感兴趣的:(nginx)