httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: [users@httpd] mod_proxy_balancer - no way to name pool members by IP.
Date Fri, 04 Feb 2011 14:26:47 GMT
On Thu, Feb 03, 2011 at 11:00:25PM +0000, Igor Gali?? wrote:
> ----- wrote:
> > I've hit a vexing impasse with mod_proxy_balancer.
> > 
> > I have a pool of backend boxes. They vhost many domains, so
> > need the specific Host: header in requests to them (the *same*
> > Host: header for all of them)
> > 
> > I proxy requests to them potentially thousands of times a second,   
> > and their IP's are not going to be changing, so I name the
> > BalancerMembers by IP address, as the DNS lookup overhead is 
> > a fatal waste of CPU, especially if your DNS servers melt
> > and your site dies unnecessarily. (No, /etc/hosts is not possible.

That only mentions ProxyBlock. We do not use ProxyBlock. Also, when we
lost DNS, we lost the site, so reality has the last word regardless.

> > The sitename has multiple A records, and I make the backends choose
> > individualiseable vhosts. Besides, my hosts file is vast!)
> > 
> > Unfortunately, when I try and use mod_headers to set the Host: header
> > for these backend connections, the balancer layer destroys the
> > result and replaces it with the IP.
> > 
> > Apparently, if I switch ProxyPreserveHost on, I may get further,
> > but since that's a site-wide setting a side effect would mean all
> Not quite sure what you mean by site-wide, but:
> says: Context:	server config, virtual host

It does. Our site is a vhost. It has squillions of proxypasses to squillions of different
backend boxes run by squillions of different people. I want to add
another backend without breaking all of the other ones.

> > of my other proxied directories would now get the wrong Host: header.
> > All the RewriteRule [P]'s would break and I would have to catch and
> Waaaait a sec.
> You're using mod_rewrite for proxying?
> Why? (

Because I'm rewriting the URL, and then proxying it? Because I'm using
rewritemaps? Because I like the letter P? Pick one :) Also, this problem
is only using ProxyPass, so mod_rewrite is not the problem here.

> > replace the Host in every single one of them in individual <Proxy>
> > blocks.
> > That deluge of perpetual kludgery does not appeal.
> > 
> > What I need is a way to tell a ProxyPass or BalancerMember, that
> > they should use a certain Host: header in its communications
> > with this backend. e.g.
> > BalancerMember
> Now I'm confused. How do your configs actually look like?

ProxyPreserveHost Off
ProxyPass /foo/ balancer://
<Proxy balancer:// >
  ProxySet lbmethod=bybusyness timeout=10
  BalancerMember lbset=0 retry=0 ttl=5
  BalancerMember    lbset=1 retry=0 ttl=5
  RequestHeader set Host
  RequestHeader set Host
ProxyPass /bar/
ProxyPass /bar1/
ProxyPass /bar2/
... receives 'Host:', not the 'Host:' I want it to. receives 'Host:' and I want to keep it that way.

> > The logical alternative would have been to be able to specify a
> > certain target IP to connect to instead of a certain Host name
> > to use e.g.
> > BalancerMember address=
> > 
> > but I suspect apache would then be unable to set <Proxy> block
> > rules for individual balancer members since they'd all declare
> > the same URL and you'd be unable to match them individually
> You can use ProxySet
> in <Proxy > and <BalancerMember >
> But ProxySet only allows you to set the same Variables as
> ProxyPass does. host is none of them.

Indeed. This appears to be the problem. Such an option is missing.


The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message