On Mar 7, 2011, at 4:48 PM, Jim Hayter wrote: > In my environment, port numbers may be on the request, but are not needed to > respond nor should they influence the cache. In my vcl_recv, I have the > following lines: > > /* determine vhost name w/out port number */ > set req.http.newhost = regsub(req.http.host, "([^:]*)(:.*)?$", "\1"); > set req.http.host = req.http.newhost; > > This strips off the port number from the host name in the request. Doing it > this way, the port number is discarded and NOT passed on to the application. > It is also not present when creating and looking up hash entries.
This looks like it does exactly what we need. I thought I was going have to monkey with server.port, or what the vcl_hash includes in its key calculation, but this is straight-forward. Thanks a lot, Jim. _______________________________________________ varnish-misc mailing list [email protected] http://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
