appendDomain issues

From: Brian Degenhardt <bmd@dont-contact.us>
Date: Tue, 29 Aug 2000 17:07:21 -0700

I've been having some really bizarre behavior from squid 2.3.STABLEX in
the last month or so, and I've finally been able to lock down what's
happening.

Symptoms:

Certain internal urls return 404 (most importantly the one for the
cache_digest). This symptom happens sporadically on different
machines with the same squid binary, conf file, and operating system
distro (RH Linux 6.2 i386).

Why:

It turns out that my /etc/hosts file varies a bit between machines. On
some machines it has an entry like:

192.168.1.10 foo.mp3.com foo

On others it is like:

192.168.2.11 bar bar.mp3.com

Therefore, the gethostbyname call in tools.c:447 will return the first entry
in the hosts file and thus, getMyHostname will also mimic this. Therefore,
in this case, the hostnames returned will be "foo.mp3.com" and "bar"
respectively.

The problem I was having was when trying to request the cache_digest on bar,
my query of GET http://bar:3128/squid-internal-periodic/store_digest was
being rewritten to bar.mp3.com... because I was using the append_domain
directive in my squid.conf file. The request for
http://bar.mp3.com:3128/squid-internal-periodic/store_digest was not found
in the cache because it was entered with the non fqdn hostname. Now you can
see how I was experiencing this problem on bar.mp3.com, but not on
foo.mp3.com even though they had the same build, conf file, and operating
system.

Solution:

There's two solutions.

The first is to have a documentation entry that warns of this pitfall on
Linux (and perhaps other unixes) telling people to list their fqdn first in
their /etc/hosts file (is there some sort of standard that requires this?).

The second solution is the attached patch to internalRemoteUri such that it
appends the domain to internal uri's when entering them into the cache such
that they will be able to be retrieved when the domain is appended to
requests.

I'm not sure if this is the right thing to do, but I'd like to be included
on any discussion just to see how this plays out.

cheers

-bmd

Received on Wed Aug 30 2000 - 03:02:22 MDT

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