Search squid archive

Re: http host rewrite for origin (reverse proxy)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On Wed, Mar 9, 2016 at 3:33 PM, Antony Stone <Antony.Stone@xxxxxxxxxxxxxxxxxxxx> 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@xxxxxxxxxxxxxxxxxxxxx
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.

_______________________________________________
squid-users mailing list
squid-users@xxxxxxxxxxxxxxxxxxxxx
http://lists.squid-cache.org/listinfo/squid-users

[Index of Archives]     [Linux Audio Users]     [Samba]     [Big List of Linux Books]     [Linux USB]     [Yosemite News]

  Powered by Linux