You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Sam Tregar <sa...@tregar.com> on 2000/04/10 23:09:32 UTC

Feature Proposal: ProxyRewriteHostHeader

Hello all.  If I'm writing to the wrong mailing-list just tell me and I'll
keep looking.  

I'd like to add a feature to mod_proxy.  I propose to add a configuration
variable 'ProxyRewriteHostHeader'.  When set to false, mod_proxy would
pass through the "Host" header from the current request.  This mirrors a
setting available in Squid - redirect_rewrites_host_header, BTW.

I would use this feature in a system where I'm hiding a poorly written
server application behind a reverse-proxy.  The application is absolutely
determined to expose its URL to the world, and as a result has to be lied
to in its "Host" header.  It also needs to be lied to by DNS, but that's
already been solved.

Dumb idea?  Already been done?  Infeasible for reasons that would become
obvious once I try to do it?  

Thanks!
-sam



Re: Feature Proposal: ProxyRewriteHostHeader

Posted by Graham Leggett <mi...@sharp.fm>.
Greg Stein wrote:

> I believe that Graham Leggett was working on some code to distinguish
> between the forward and reverse aspects. Essentially, to modularize the
> pieces so that it is easier to make choices about this stuff.

So far I have created (and posted) a patch that intends to "fix" the
mod_proxy as it stands now. It adds HTTP/1.1 support, and removes most
of the FIXMEs that were in the original implementation. The point behind
this exersize was to make sure we had a stable and complete
implementation to use as a starting off point before starting work on
mod_proxy for v2.0.

>From discussions I have had so far, it looks like mod_proxy will be a
very different beast than it was in v1.3. One idea is to separate the
"cache" aspects from the "proxy" aspects of mod_proxy, and then spread
the "cache" functionality throughout the server. Instead of just remote
requests, simple HTML and CGI requests will be cachable.

I don't know what is to happen to the "forward" caching behavior of
mod_proxy. To be honest I believe it is a security risk - an incorrectly
configured mod_proxy can work, but then allow someone to use it as a
gateway into your network. One of the things I intent doing is making
the configuration of the "reverse" behavior very different to the
"forward" behavior to ensure none of this is confused with each other.

It was suggested a while back that the forward functionality be canned,
and some people protested. Either way I don't mind, as long as the two
functions are clearly distinguished from each other.

Regards,
Graham
--

Re: Feature Proposal: ProxyRewriteHostHeader

Posted by Ben Laurie <be...@algroup.co.uk>.
Greg Stein wrote:
> IMO, abandoned. But let me qualify: the *forward* proxy aspect should be
> dropped and that functionality deferred to Squid. The reverse proxy case,
> where Apache sits in front of a dozen "interior" web servers, is still
> useful. But even then, I'm not sure that all of Apache is needed for that
> (e.g. a simple load balancer replaces much of this). I'm a bit torn on the
> reverse proxy part, because I do see people's position that a front-end
> Apache can perform a number of tasks (auth, page assembly, static content
> delivery, etc) and defer to the back-ends for other, more complex pieces.

I strongly suspect that mod_backhand is the right answer for this, not
mod_proxy. But I could be wrong - I haven't played yet.

Cheers,

Ben.

--
http://www.apache-ssl.org/ben.html

Re: Feature Proposal: ProxyRewriteHostHeader

Posted by Sam Tregar <sa...@tregar.com>.
On Tue, 11 Apr 2000, Greg Stein wrote:

> IMO, abandoned. But let me qualify: the *forward* proxy aspect should be
> dropped and that functionality deferred to Squid. 

Aha.  Now I begin to see.  I'm not sure I agree, but I see what you're
getting at.

> The reverse proxy case,
> where Apache sits in front of a dozen "interior" web servers, is still
> useful. But even then, I'm not sure that all of Apache is needed for that
> (e.g. a simple load balancer replaces much of this). I'm a bit torn on the
> reverse proxy part, because I do see people's position that a front-end
> Apache can perform a number of tasks (auth, page assembly, static content
> delivery, etc) and defer to the back-ends for other, more complex pieces.

In my particular situation we're using the reverse-proxy to extend our
Apache/mod_perl authentication over a number of "interior" ("inferior"!)
servers, wrapping their authentication with our own.  I don't think this
would be possible without a reverse-proxy within Apache.  At least it
wouldn't be so easy.

Similarily, mod_rewrite's proxy option ([P]) is insanely useful in the
right situation.

> I believe that Graham Leggett was working on some code to distinguish
> between the forward and reverse aspects. Essentially, to modularize the
> pieces so that it is easier to make choices about this stuff.

That would be useful.

Thanks for the detailed explanation.  I'm new around these parts and I
appreciate the help.

-sam



Re: Feature Proposal: ProxyRewriteHostHeader

Posted by Greg Stein <gs...@lyra.org>.
On Wed, 12 Apr 2000, Sam Tregar wrote:
> On Tue, 11 Apr 2000, Greg Stein wrote:
>...
> > That said, I'm ambivalent (leaning towards no) since I don't think we
> > should really be involved in proxy-anything.
> 
> Really?

No, I'm lying... of course really :-)

> Is mod_proxy in danger of being canned?

Certainly not. I'm just one voice. I can refuse to fix bugs or enhance
mod_proxy, but others will and do step up to do it. There are still a good
number of people that like and want mod_proxy. The general rule at ASF is
that something can go into the standard distribution if (and only if)  
there is a maintainer for it. Unfortunately, there isn't a clear rule on
what to do when the maintainer is no longer active -- you end up with
unmaintained code (which the entry rule is used to prevent). A few months
ago, I spoke up to have mod_proxy removed because there was no apparent
maintainer and it was generating quite a few bug reports. That is a poor
situation for the rest of us since we don't know the code, can't really
fix the bugs, can't fix the documentation, can't answer questions, etc.
Having that chunk of stuff can also reflect poorly on Apache as a whole.

[ note that there are other pieces in Apache that don't have maintainers
  either, but none approach the complexity of mod_proxy ]

However, for the mod_proxy case, a couple people have stepped up to offer
their support for it. As a result, it doesn't truly have to go :-)

> That's pretty shocking
> to hear - it's a very useful module.  Do you mean that it should be moved
> out of the core distribution or abandoned entirely?

IMO, abandoned. But let me qualify: the *forward* proxy aspect should be
dropped and that functionality deferred to Squid. The reverse proxy case,
where Apache sits in front of a dozen "interior" web servers, is still
useful. But even then, I'm not sure that all of Apache is needed for that
(e.g. a simple load balancer replaces much of this). I'm a bit torn on the
reverse proxy part, because I do see people's position that a front-end
Apache can perform a number of tasks (auth, page assembly, static content
delivery, etc) and defer to the back-ends for other, more complex pieces.

I believe that Graham Leggett was working on some code to distinguish
between the forward and reverse aspects. Essentially, to modularize the
pieces so that it is easier to make choices about this stuff.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/


Re: Feature Proposal: ProxyRewriteHostHeader

Posted by Sam Tregar <sa...@tregar.com>.
On Tue, 11 Apr 2000, Greg Stein wrote:

> 1) yes, code is always better

Ok then, I'll get on it.

> 2) writing it against Apache 2.0 stands a *much* better chance of the
>    patch being integrated (probably without question). writing it against
>    1.3 will need a much higher bar...

I guess I'll see about doing both.  Since I plan to use this in a current
project I'd need something working in 1.3.  Perhaps that would be a
"private" patch though - I can understand wanting to put new features into
2.0 alone.

> That said, I'm ambivalent (leaning towards no) since I don't think we
> should really be involved in proxy-anything.

Really?  Is mod_proxy in danger of being canned?  That's pretty shocking
to hear - it's a very useful module.  Do you mean that it should be moved
out of the core distribution or abandoned entirely?

Would you mind explaining your position a little more fully?

-sam



Re: Feature Proposal: ProxyRewriteHostHeader

Posted by Greg Stein <gs...@lyra.org>.
On Tue, 11 Apr 2000, Sam Tregar wrote:
> On Mon, 10 Apr 2000, Graham Leggett wrote:
> > Sam Tregar wrote:
> > 
> > > I'd like to add a feature to mod_proxy.  I propose to add a configuration
> > > variable 'ProxyRewriteHostHeader'.  When set to false, mod_proxy would
> > > pass through the "Host" header from the current request.  This mirrors a
> > > setting available in Squid - redirect_rewrites_host_header, BTW.
> > 
> > I needed that feature today... if you write it, you have at least one
> > user :)
> 
> Great.  I'm still waiting for someone with authority to give it the
> OK.  Do you know if anyone is in charge of mod_proxy?  In Perl-land we'd
> call them the mod_proxy Pumpking, but I imagine you do things differently
> in Apache territory.
> 
> If I don't hear anything for a few more days I'll just go ahead and give
> it a try.  Perhaps proposals with patches get better responses?

Two points:

1) yes, code is always better
2) writing it against Apache 2.0 stands a *much* better chance of the
   patch being integrated (probably without question). writing it against
   1.3 will need a much higher bar...

That said, I'm ambivalent (leaning towards no) since I don't think we
should really be involved in proxy-anything.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/



Re: Feature Proposal: ProxyRewriteHostHeader

Posted by Sam Tregar <sa...@tregar.com>.
On Mon, 10 Apr 2000, Graham Leggett wrote:

> Sam Tregar wrote:
> 
> > I'd like to add a feature to mod_proxy.  I propose to add a configuration
> > variable 'ProxyRewriteHostHeader'.  When set to false, mod_proxy would
> > pass through the "Host" header from the current request.  This mirrors a
> > setting available in Squid - redirect_rewrites_host_header, BTW.
> 
> I needed that feature today... if you write it, you have at least one
> user :)

Great.  I'm still waiting for someone with authority to give it the
OK.  Do you know if anyone is in charge of mod_proxy?  In Perl-land we'd
call them the mod_proxy Pumpking, but I imagine you do things differently
in Apache territory.

If I don't hear anything for a few more days I'll just go ahead and give
it a try.  Perhaps proposals with patches get better responses?

-sam



Re: Feature Proposal: ProxyRewriteHostHeader

Posted by Graham Leggett <mi...@sharp.fm>.
Sam Tregar wrote:

> I'd like to add a feature to mod_proxy.  I propose to add a configuration
> variable 'ProxyRewriteHostHeader'.  When set to false, mod_proxy would
> pass through the "Host" header from the current request.  This mirrors a
> setting available in Squid - redirect_rewrites_host_header, BTW.

I needed that feature today... if you write it, you have at least one
user :)

Regards,
Graham
--