[squid-users] http host rewrite for origin (reverse proxy)

Tomas Mozes hydrapolic at gmail.com
Wed Mar 9 15:30:16 UTC 2016


On Wed, Mar 9, 2016 at 3:33 PM, Antony Stone <
Antony.Stone at squid.open.source.it> wrote:

> On Wednesday 09 March 2016 at 15:29:48, Tomas Mozes wrote:
>
> > the origin server has multiple virtual hosts configured, so if it does
> not
> > receive the Host: header by which it is configured (like
> > storage.example.com), it will emit a 404.
> >
> > Currently, this does the following. The clients requests:
> > GET /test.txt HTTP/1.1
> > Host: cdn.example.com
> >
> > This comes to squid, it will then send the same request to the origin:
> > GET http://cdn.example.com/test.txt HTTP/1.1
> > Host: cdn.example.com
> >
> > The result is a 404. I would need squid to alter the Host: to
> > storage.example.com. Is that possible?
> >
> > What I can do is to add a cdn.example.com server alias to the origin,
> then
> > it works of course.
>
> 1. Why not do that, then?
>
> 2. Have you considered using Apache in reverse-proxy mode instead of Squid?
> It will happily re-write headers for you, and also supports load balancing
> around multiple servers, which would possibly give you a high-availability
> solution as well.
>
>
> Antony.
>
> --
> Douglas was one of those writers who honourably failed to get anywhere with
> 'weekending'.  It put a premium on people who could write things that
> lasted
> thirty seconds, and Douglas was incapable of writing a single sentence that
> lasted less than thirty seconds.
>
>  - Geoffrey Perkins, about Douglas Adams
>
>                                                    Please reply to the
> list;
>                                                          please *don't* CC
> me.
> _______________________________________________
> squid-users mailing list
> squid-users at lists.squid-cache.org
> http://lists.squid-cache.org/listinfo/squid-users
>


1. Because when you have a normal cdn bought from commercial parties, you
don't add a cdn.example.com vhost alias into your configuration ;) It's
just not right. The cdn should be transparent.

2. Squid allows to create a hierarchy of caches (mesh) and can cache in
memory - these are the reasons not to use Apache/Nginx in my case. Yes, you
can use a distributed file system, but that's an extra layer. And yes,
Apache can cache to disk and OS will cache into RAM. It seems squid + ICP +
mesh is just fine for what I need.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squid-cache.org/pipermail/squid-users/attachments/20160309/0fba3896/attachment.html>


More information about the squid-users mailing list