Hello!
On Mon, Mar 17, 2014 at 6:15 AM, Michael Rushanik wrote:
> The question is it possible to configure keepalive without upstream module,
> using the reverse proxy only?
Note that the standard ngx_proxy module *is* an nginx upstream module.
I think you just mean that you are not using the "upstream" directive
to group your backend servers.
Well, to use the ngx_http_upstream_keepalive module to do connection
pooling for ngx_proxy, you have to use the "upstream" directive.
You can still use the "upstream" to define the host names you might
use like this:
upstream
foo.com {
server
foo.com;
keepalive 10;
}
upstream
bar.com {
server
bar.com;
keepalive 10;
}
as long as you can know the full list of domains you might use (or
just the hottest ones that need connection pooling most). That way,
when you do
set $target '
foo.com';
proxy_pass $target;
The ngx_proxy module will pick up your upstream
foo.com {} first and
no dynamic domain name resolving is needed at all.
Regards,
-agentzh