If response will be bigger than proxy_buffer_size, then backend will
be tied to nginx until the data will be sent to cliant.
The maximum data size that nginx can read from backend at once in this mode
is proxy_buffer_size.
maybe i’m misunderstanding something here.
as far as i see, there are 2 separate “features”:
-
nginx reads the whole response from the proxied apache and “frees”
apache, even when nginx is not immediately able to send it to the
client. -
nginx does not start to send the response to the client until the
whole response is read from apache (or until it has read
“proxy_buffer_size” bytes from apache)
my problem is #2, not #1. it seems that doing a “proxy_buffering = off”
solves #2, but maybe it does also #1.
is there a way to only do #2, but not #1?
maybe it helps if i explain my situation in more detail:
the apache web-app generates a webpage dynamically, the following way:
A. generate the first part
B. do some computation
C. generate the second part
it’s very important that after step #A, the client immediately gets that
part of the webpage. with proxy_buffering enabled, it does not happen,
because nginx seems to wait for the whole response (or for enough data
to fill it’s buffers).
it seems that “proxy_buffering=off” achieves what i need. but as i
understood from your response, it also means that the apache-worker will
be blocked until the whole response is sent to the client. is there a
way to have what i need, and still have buffering enabled?
(well, there is the possibility to send a lot of empty-space in the html
to fill nginx’s buffers, but that’s not a nice solution
thanks,
gabor