I want to use the hash director in Varnish to redirect all requests for a same URL without query parameters to the same server:
For example,
http://example.com/foo/bar?a=1
http://example.com/foo/bar?a=2&b=3
Should hash to the same server. I want to hash on host and path only.
Here is my configuration:
sub vcl_init {
new workers = directors.hash();
workers.add_backend(worker_1, 1);
workers.add_backend(worker_2, 1);
workers.add_backend(worker_3, 1);
}
I understand I need to set the hash function here:
sub vcl_recv {
set req.backend_hint = workers.backend(...);
}
What should I put in there to hash on host + path, without query string?