why 'client closed prematurely connection while sending request to upstream' ?

Yu.Cheung nkcheungyu at gmail.com
Tue Apr 21 06:52:15 MSD 2009


Hi,
    All.
    I want to proxy twice. but there was something wrong with it.

   what I want to do:

    client send request----->nginx server------->sending(proxy_pass)
its header to the backend server 1 ---->back to ngx server---->proxy
pass to the second backend server---->back to ngx server---->response
to client.

    but when the request was sent to backend server 1, 'the client
closed prematurely connection while sending request to upstream' came,
 all of my http servsers are Nginx.

   the simple conf (just use virtual 3 servers) is:

   http {
  include       mime.types;
  default_type  text/html;
  expires       -1;


  sendfile        on;


  client_max_body_size 10000m;



  server {
	
	  server_name front;
	  listen 8389;
	
	  location / {
		
	  if ($uri ~ "/(.*)") {
		  set $fn $1;
		  }
		
	  proxy_ignore_client_abort on;
	
	  proxy_pass_request_body off;
	  proxy_pass http://10.68.3.23:8390;


	  location /pass {
              proxy_pass_request_body on;
	      proxy_pass http://10.68.3.23:8388/$fn;
        }

	  location /download {
	     proxy_pass http://10.68.3.23:8388/$fn;
		  }

		
	  }#end of location /

	  }#server

  server {
	
	  server_name transfer;
	  listen 8390;
	  proxy_ignore_client_abort  on;
	
	  location / {
	         set $loc "/pass";
		 add_header "X-Accel-Redirect" $loc;
		 return 301;
	    }

		
	  }#backend server 1


server {
     server_name storage;
     listen 8388;



    location / {
                root /data;
		 client_body_temp_path /data1/client_tmp;

		 dav_methods PUT DELETE MKCOL COPY MOVE;
		
		 create_full_put_path on;
		 dav_access user:rw group:rw all:rw;

                  limit_except GET {
			 allow all;
			 }		
    }

  }#backend server 2


}#http

---------------------------
when i put one file to test, while sending to the first upstream
server(backend 1), the connection closed.
why ?

Thanks.





More information about the nginx mailing list