如何立即发送标题

<?php
header("X-Accel-Buffering: no");
header('Content-Encoding: none;');
//and yet other headers

ob_end_flush();
flush();
sleep(1);

echo time().PHP_EOL;
flush();
sleep(2);
echo time().PHP_EOL;

So, when I use Apache + php, and turn off buffering in Apache and php, and get a page of this scipt, I will see in firebug, that the time of waiting response is about 0(localhost used)

but, if the same way with nginx with php-fpm, I will see, that the time of waiting response is about 1second.

So, nginx (or php-fpm) doesn't want to send headers immediately. Why? how can I do my task?

PS according different forums

nginx conf - proxy_buffering off; fastcgi_max_temp_file_size 0; fastcgi_keep_conn on; gzip off;

php conf output_buffering = Off

The X-Accel-Buffering: no header does not affect fastcgi_buffering until >= nginx-1.5.6. This is likely the cause of your problems, because the default fastcgi buffers are 4-8k, and are utilized in an nginx+php-fpm setup.