aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Enderlin <ivan.enderlin@hoa-project.net>2015-02-24 16:43:16 +0100
committerIvan Enderlin <ivan.enderlin@hoa-project.net>2015-02-24 16:43:16 +0100
commit242d4f198d0f3da6c74fb6bc89ce128e3b19819f (patch)
tree714f56b5535ffd0cd7273ceb103a904dca8e39e9
parentff26c43668acb587c0f0e90ddd8247613ad52e5f (diff)
downloadEventsource-242d4f198d0f3da6c74fb6bc89ce128e3b19819f.zip
Eventsource-242d4f198d0f3da6c74fb6bc89ce128e3b19819f.tar.gz
Eventsource-242d4f198d0f3da6c74fb6bc89ce128e3b19819f.tar.bz2
Disable proxy buffering on nginx.
nginx has, by default, an output buffering. We can turn it off by using the `proxy_buffering` directive but it can be cumbersome in some cases. We let the user decide whether adding this directive or not. However, we use the `X-Accel-Buffering` header to disable the buffering for this specific resource. Please, see http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_buffering.
-rw-r--r--Server.php1
1 files changed, 1 insertions, 0 deletions
diff --git a/Server.php b/Server.php
index f79f071..2576e92 100644
--- a/Server.php
+++ b/Server.php
@@ -119,6 +119,7 @@ class Server {
$this->_response->sendHeader('Content-Type', self::MIME_TYPE);
$this->_response->sendHeader('Transfer-Encoding', 'identity');
$this->_response->sendHeader('Cache-Control', 'no-cache');
+ $this->_response->sendHeader('X-Accel-Buffering', 'no');
$this->_response->newBuffer();
return;