Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have problem somewhere between nginx and php-fpm. When I use keep-alive connection for fastgcgi php-fpm, there is often problem with loading page. Page not completely loaded. I tried to debug using wireshark, and see that php-fpm send to nginx coplete reply, but nginx to client sent incoplete page. Size of incomplete page is defined by chunk size. For test, download http://kinohled.cz/bugreport.tar.gz and run ./showBug.sh . You will se:

Run Nginx on port 9876
Run php-fpm on port 6789
Correct size of answer is 16172;
keepalive on,  size:  8002
keepalive off, size: 16172
 Next test (1 of 5)-

Tested on Debian Squeeze and many version of Nginx/PHP-FPM . Error shows on default Nginx/PHP-FPM version by Debian Squeeze by dotdeb.org .

PHP 5.3.21-1~dotdeb.0

On Nginx error log:

upstream sent unsupported FastCGI protocol version: 0 while reading upstream

Any suggestion ?

share|improve this question
It may be completely unrelated, but try to increase the php-fpm pm.max_children = 10 and switch to unix sockets instead of tcp. –  Martino Dino Jan 31 '13 at 10:54
pm.max_children = 10 and unix socket ... ... nothing change. Sorry. :( –  Ondrej Prochazka Jan 31 '13 at 12:23
This patch help me: mdounin.ru/temp/patch-nginx-fastcgi-keepalive.txt Thanks to Maxim Dounin for fast help. forum.nginx.org/read.php?2,235764,235776#msg-235776 –  Ondrej Prochazka Jan 31 '13 at 12:45
Indeed, I'm impressed with nginx :) –  Martino Dino Jan 31 '13 at 13:12

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.