<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 9, 2016 at 3:33 PM, Antony Stone <span dir="ltr"><<a href="mailto:Antony.Stone@squid.open.source.it" target="_blank">Antony.Stone@squid.open.source.it</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="">On Wednesday 09 March 2016 at 15:29:48, Tomas Mozes wrote:<br>
<br>
> the origin server has multiple virtual hosts configured, so if it does not<br>
> receive the Host: header by which it is configured (like<br>
> <a href="http://storage.example.com" rel="noreferrer" target="_blank">storage.example.com</a>), it will emit a 404.<br>
><br>
> Currently, this does the following. The clients requests:<br>
> GET /test.txt HTTP/1.1<br>
> Host: <a href="http://cdn.example.com" rel="noreferrer" target="_blank">cdn.example.com</a><br>
><br>
> This comes to squid, it will then send the same request to the origin:<br>
> GET <a href="http://cdn.example.com/test.txt" rel="noreferrer" target="_blank">http://cdn.example.com/test.txt</a> HTTP/1.1<br>
> Host: <a href="http://cdn.example.com" rel="noreferrer" target="_blank">cdn.example.com</a><br>
><br>
> The result is a 404. I would need squid to alter the Host: to<br>
> <a href="http://storage.example.com" rel="noreferrer" target="_blank">storage.example.com</a>. Is that possible?<br>
><br>
> What I can do is to add a <a href="http://cdn.example.com" rel="noreferrer" target="_blank">cdn.example.com</a> server alias to the origin, then<br>
> it works of course.<br>
<br>
</span>1. Why not do that, then?<br>
<br>
2. Have you considered using Apache in reverse-proxy mode instead of Squid?<br>
It will happily re-write headers for you, and also supports load balancing<br>
around multiple servers, which would possibly give you a high-availability<br>
solution as well.<br>
<span class=""><font color="#888888"><br>
<br>
Antony.<br>
<br>
--<br>
Douglas was one of those writers who honourably failed to get anywhere with<br>
'weekending'.  It put a premium on people who could write things that lasted<br>
thirty seconds, and Douglas was incapable of writing a single sentence that<br>
lasted less than thirty seconds.<br>
<br>
 - Geoffrey Perkins, about Douglas Adams<br>
<br>
                                                   Please reply to the list;<br>
                                                         please *don't* CC me.<br>
</font></span><div class=""><div class="h5">_______________________________________________<br>
squid-users mailing list<br>
<a href="mailto:squid-users@lists.squid-cache.org">squid-users@lists.squid-cache.org</a><br>
<a href="http://lists.squid-cache.org/listinfo/squid-users" rel="noreferrer" target="_blank">http://lists.squid-cache.org/listinfo/squid-users</a></div></div></blockquote><div><br><br><div>1. Because when you have a normal cdn bought from commercial parties, you don't add a <a href="http://cdn.example.com" target="_blank">cdn.example.com</a> vhost alias into your configuration ;) It's just not right. The cdn should be transparent.<br></div><br>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. <br></div></div><br></div></div>