<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div class="h5">It's a possibility... I don't know offhand which browsers include the</div>
</div>
port in the host header for standard ports. It might be a good idea to<br>
use a regsub to delete a trailing :\d+ from the host header on every<br>
request just to be sure (assuming the port isn't important to you).<br></blockquote><div> </div><div>Good idea. I'll do it today. Thanks.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
Also I had another thought that you should check your vcl_hash to make<br>
sure it's including any information you or your backends use to decide<br>
which content to serve. For example if it wasn't incorporating the<br>
host header into the hash (only the request path) then the first<br>
resource with a particular path would be cached by Varnish, and then<br>
served for any request with the same path, regardless of host.<br></blockquote><div><br></div><div>I'm using the default vcl_hash. I didn't really read about vcl_hash yet.</div><div><div><i>sub vcl_hash {</i></div>
<div><i> hash_data(req.url);</i></div><div><i> if (req.http.host) {</i></div><div><i> hash_data(req.http.host);</i></div><div><i> } else {</i></div><div><i> hash_data(server.ip);</i></div><div><i> }</i></div>
<div><i> return (hash);</i></div><div><i>}</i></div></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
Do your backends make use of the X-Sub or X-Host header you add to the<br>
request? If so, you'd want to make sure they're incorporated into the<br>
object's hash. If you're only using them temporarily to build<br>
redirects etc. then that's occurring before the cache lookup, so<br>
shouldn't be a concern. </blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
If you're not already, it might also be worthwhile checking the<br>
request actually includes the host header and displaying an error<br>
message or something if it's missing. Probably unlikely to be the case<br>
with any graphical browser in use today, but it never hurts to be<br>
thorough.<br>
<br>
Lastly, if you can't find a way to reproduce this on demand, then<br>
getting logs from it may be difficult. It might be worthwhile to set<br>
up a "dummy" backend as the first one Varnish loads, which should<br>
never actually be used by any of your sites. That way if it does<br>
somehow get used, you'll know the request somehow failed to get<br>
assigned to a backend, and you can log the request (on the dummy<br>
backend, even) - maybe something about it will stick out as the<br>
obvious culprit. Plus, it'd avoid accidentally serving certain images<br>
to unsuspecting users.<br>
<div><div></div><div class="h5"><br>
_______________________________________________<br>
varnish-misc mailing list<br>
<a href="mailto:varnish-misc@varnish-cache.org">varnish-misc@varnish-cache.org</a><br>
<a href="https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc" target="_blank">https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc</a><br>
</div></div></blockquote></div><br>