2

Is it possible for Varnish to parse the hostname to determine which backend to use? I'd like to avoid having to do:

if (url = 'backend1') {
    set req.backend = backend1;
}

.. for all of them.

I'd like to be able to do something like this:

set req.backend = regsub(req.http.Host, "^.*([^.]+)\.mydomain\.com$", "\1");

.. but that doesn't work.

1 Answer 1

1

No, that is not possible at the moment. You could use build scripts that build your varnish configuration automatically. The varnish developers are thinking about dynamic backend declaration possibilites, which would cover your use case. The dev is asking for comapnies that would use this feature, so you maybe want to tell him that you are interested ;-)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .