Dirk Gomez <[EMAIL PROTECTED]> writes: > sub vcl_recv { > if (req.request == "POST") { > pipe; > } > > # force lookup even when cookies are present > if (req.request == "GET" && req.http.cookie) { > lookup; > } > > if (req.http.host ~ "^hop.metatest.de") { > set req.backend = thishost; > } elsif (req.http.host ~ "^zop.metatest.de") { > set req.backend = thathost; > } else { > error 404 "Unknown virtual host"; > } > > > }
You should select the backend *before* checking for POST or cookies. > varnishlog gives me this output: > > 13 RxHeader c Connection: keep-alive > 13 RxHeader c Host: zop.metatest.de > 13 VCL_call c recv > 13 VCL_return c lookup > 13 VCL_call c miss > 13 VCL_return c fetch > 17 BackendClose default > 17 BackendOpen b default 127.0.0.1 46677 127.0.0.1 7080 > > So varnish goes to 127.0.0.1 instead of 192.168.100.199. Most likely, the client sent a cookie. DES -- Dag-Erling Smørgrav Senior Software Developer Linpro AS - www.linpro.no _______________________________________________ varnish-misc mailing list varnish-misc@projects.linpro.no http://projects.linpro.no/mailman/listinfo/varnish-misc