Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output buffering issues with nginx, php5-fpm and EventSource #6954

Closed
bantu opened this issue Jan 26, 2014 · 1 comment · Fixed by #9924
Closed

Output buffering issues with nginx, php5-fpm and EventSource #6954

bantu opened this issue Jan 26, 2014 · 1 comment · Fixed by #9924

Comments

@bantu
Copy link

bantu commented Jan 26, 2014

I am using ownCloud on php5-fpm via nginx.

When downloading files via link, the EventSource class is used to communicate with the JavaScript EventSource client which in turn updates the user visible progress bar. Albeit EventSource::send() performs a call to flush(), the data never makes it to the browser before the file is completely downloaded.

This is because nginx buffers the body for various reasons (this is usually the default behaviour). For example when gzip is on, the response has to be buffered in order to get the content-length header right.

The manual at http://nginx.org/en/docs/http/ngx_http_fastcgi_module.html#fastcgi_buffering suggests that header('X-Accel-Buffering: no') could be used to disable buffering when necessary (which is desirable), but the option is not available before version 1.5.6.

Furthermore, I can sofar confirm that using "fastcgi_keep_conn on;" in the nginx config also fixes the issue, although I am not 100% sure why.

@jancborchardt
Copy link
Member

If you already have a possible solution, can you just submit a pull request? Thanks

@lock lock bot locked as resolved and limited conversation to collaborators Aug 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants