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

From: <peter@dont-contact.us>
Date: Fri, 22 Jun 2001 09:58:38 -0400 (EDT)

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 22 2001 - 08:04:23 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 17:00:49 MST