On Thu, Apr 10, 2008 at 6:36 AM, Amos Jeffries <squid3@xxxxxxxxxxxxx> wrote:
> Here you go:
>
> # Listen on port 80,
> http_port 80 accel defaultsite=mysite.com vhost
>
> # actual data source is 1.2.3.4
> # (IP or domain MUST NOT resolve to squid IP)
> cache_peer 1.2.3.4 parent 80 0 no-query originserver name=mySitePeer
>
> # only accept requests for "mysite.com" or "www.mysite.com"
> acl mySites dstdomain mysite.com www.mysite.com
> cache_peer_access mySitePeer allow mySites
> http_access allow mySites
>
> # stop random people abusing me with spam traffic.
> allow_direct deny all
> http_access deny all
i got an error on the "allow_direct" line so i commented it out.
right now this is all running on dev boxes behind a firewall so it's
no big deal about access control.
> > If I access the cache at it's IP address (http://10.0.2.19/) it
does not
> send the Host: mysite.com header back to the origin. If I use curl to
> inject a Host: header into the request, it does work. I want it to
always
> inject that Host: header if it's missing.
> >
>
> It should be doing it. Try with the fixed config above. If you still
see no
> Host: I'll have a closer look at the code.
with the config above, i can't hit the squid server *without* the
header so it doesn't show the problem... but that's ok, i can live
with this. it's not likely that real world clients will hit the squid
box without the right Host: header anyway.
> > Cache-Control: max-age=15, must-revalidate
> > Content-Type: text/html; charset=UTF-8
> >
> > Squid is not obeying the Cache-Control though. It always contacts the
> origin on every request.
>
> It should be.
> "must-revalidate" means contact the origin and check for new data.
Try just
> max-age alone.
>
> And check that your server and squid machines are synced properly
for time.
> If they are out by 15sec that could cause this behavior.
They are in sync but it's still happening.
-jsd-