Re: [squid-users] Port # gets appended to Host header- patch (Re: q about redirect_rewrites_host_header)

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Fri, 29 Jun 2001 17:19:41 +0200

Your concerns are valid I think, and stems from the fact that the
current httpd_accel_* directives are too primitive to accurately
represent the needs when building reverse proxies / "accelerators".

To address this and many other related issues there is a (completed)
task for reverse-proxy enhancements in Squid. See
http://squid.sourceforge.net/rproxy/. The goal is to have this included
in Squid-2.6.

--
Henrik Nordstrom
Squid Hacker
peter@peter.nyc.ny.us wrote:
> 
> hi- following up to my own post for lack of response.:)
> 
> i noticed that squid was appending the port number from
> "httpd_accel_port" to the 'Host:' header line, even
> with redirect_rewrites_host_header off. i poked around
> and see why it works this way, but i did make a patch
> to client_side.c to make it behave as i want. (see
> below.) if you have "redirect_rewrites_host_header off"
> and "httpd_accel_single_host on", it does not append
> the port number. (a better solution might be to
> disassociate the host header from the actual host....)
> 
> as i mentioned before, i want to use squid in
> accelerator mode, solely as a *dumb*, do-nothing buffer
> between slow browsers and my memory-intensive httpd
> processes. ie- i want it to buffer requests and
> responses in memory, do no caching, have no
> access-control, have no other logic. is there another
> simpler piece of software that will do this better?
> 
> thanks!
> peter
> 
> client_side.c (squid-2.4.STABLE1) diff:
> 
> <           int vport = (int) Config.Accel.port;
> ---
> >           int vport = (Config.Accel.single_host && !Config.onoff.redir_rewrites_host) ?
> >             0 : (int) Config.Accel.port;
> >
> 2419,2420c2421,2426
> <           snprintf(http->uri, url_sz, "http://%s:%d%s",
> <               t, vport, url);
> ---
> >           if (vport > 0) {
> >               snprintf(http->uri, url_sz, "http://%s:%d%s",
> >                        t, vport, url);
> >           } else {
> >               snprintf(http->uri, url_sz, "http://%s%s", t, url);
> >           }
> 
> -------------------------------------------------------------
> 
> On Wed, 20 Jun 2001 peter@peter.nyc.ny.us wrote:
> 
> >
> > hello! i'm trying to use squid as a completely dumb,
> > completely transparent, non-caching proxy.
> > (ie- as a buffer for some beefy webserver procs.)
> >
> > my configuration is the following:
> >  http_port 80
> >  httpd_accel_single_host on
> >  httpd_accel_host 127.0.0.1
> >  httpd_accel_port 880
> >  httpd_accel_with_proxy off
> >  httpd_accel_uses_host_header on
> >  redirect_rewrites_host_header off
> >  no_cache deny all
> >  http_access allow all
> >
> > everything works as i want, except that
> > squid still appends the port "880" to the Host header,
> > even though i have "redirect_rewrites_host_header off".
> > is there any way to have it not append the port?
> >
> > (Also i noticed that if i made my browser request have
> > ":80" at the end, squid removes the port from the Host
> > header.)
> >
> > i know i can get around this by binding the underlying
> > webserver to port 80 on a separate ip, but don't
> > particularly want to do this.
> >
> > thanks in advance!
> > peter
> >
Received on Fri Jun 29 2001 - 09:32:48 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:14:04 MST