I have apache as an internal server that runs php scripts and nginx as a reverse proxy that deals with static content. A php script that gives me the identifier of some process and then executes this process (rather long). I need to pass to the browser only the identifier of this process.
ob_start();
echo json_encode($arResult);
$contentLength = ob_get_length();
header('Connection: close');
header('Content-Length: ' . $contentLength);
ob_end_flush();
ob_flush();
flush();
(I check the status of the process with another ajax-script)
This works just fine under Apache. But I have problems when apache is behind nginx. In this case, I get a response only when the process is complete.
Nginx settings:
server {
proxy_set_header Connection close;
proxy_pass_header Content-Length;
}
But I still get Connection keep-alive in FireBug.
How can I get nginx to immediately give an answer from apache?
Hope the question is clear.
Thank.