upstream sent invalid status "-1 Copy failed" while reading response header from upstream

NaZz nginx-forum at
Sun Oct 26 01:21:49 UTC 2014

I have a joomla website and when I am trying to update a larger extension I
get bad gateway (502) error.
I am able to update all small (normal) extensions.

I am getting this error in nginx error log:  "upstream sent invalid status
"-1 Copy failed" while reading response header from upstream"

I have checked the php-fpm log and there is nothing there connected to this
particular error(I have it enabled in config).

All files and folders have www-data owner and proper permissions (I even
tried with 777).

There are parts of nginx.conf that I tried editing to fix this issue but it
didn't work:

http {

	# Basic Settings
	fastcgi_read_timeout 5m;
        fastcgi_buffers 8 16k;
        fastcgi_buffer_size 32k;
	client_max_body_size 2M;
	sendfile on;
	tcp_nopush on;
	tcp_nodelay on;
	keepalive_timeout 6;
	types_hash_max_size 2048;


CGI settings in sites-enabled conf:

# pass the PHP scripts to FastCGI server listening on
	location ~ \.php$ {
		try_files $uri =404;
		fastcgi_split_path_info ^(.+\.php)(/.+)$;
		# NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
		# With php5-cgi alone:

		# With php5-fpm:
		fastcgi_pass unix:/var/run/php5-fpm.sock;
		fastcgi_index index.php;
		include fastcgi_params;

I have tried searching this problem everywhere and tried many suggested
fixes but I am unable to fix this issue.

Interesting problem is that I think its connected to the file size which I
am trying to update (its around 3MB only still but bigger than all
successfully updated extensions). The file (tar.gz gets updated successfully
I think but after its being extracted or updated the error jumps)

My php.ini max_upload_size is 20M

Posted at Nginx Forum:,254276,254276#msg-254276

More information about the nginx mailing list