nginx_push_stream module and X-Accel-Redirect, nginx sub-request issue?
mdounin at mdounin.ru
Mon Jul 4 01:56:19 MSD 2011
On Tue, Jun 21, 2011 at 11:48:59AM +1000, Robert Mueller wrote:
> I'm trying to use the nginx push stream module here:
> The general flow is that the client connects to https://server/events/,
> which internally does some auth checks on the connection, and then does
> X-Accel-Redirect to to https://server/sub?id=*channelname* to connect
> the push channel to the user.
> Unfortunately nginx closes the connection after 5 seconds. I asked the
> module author about this, and he mentioned that he had already seen the
> issue, but it's related to an internal nginx code design with sub
> requests which he talks about here:
> Not being an expert on the code, I'm not sure where the issue is, but
> was hoping to connect people so it can be resolved :)
(in case it's still intresting)
This looks like the problem in push stream module from here. It
incorrectly set r->discard_body by hand instead of using
ngx_http_discard_request_body() function, and this causes
lingering to be activated and close connection as long as there
are no data from client within lingering_timeout (5s by default).
More information about the nginx