req.url modified in restart?

Dridi Boukelmoune dridi at varni.sh
Thu Apr 27 13:15:51 CEST 2017


> sub vcl_recv {
>     if (req.url ~ "^\/foo\/") {

Here you are looking for /foo/ at the beginning of the URL.

>         set req.url = regsub(req.url, "^\/foo\/", "/");
>         set req.backend_hint = special_backend;
>     } else {
>         set req.backend_hint = default;
>     }
> }
>
> For this test I ran:
>
> $ python -m SimpleHTTPServer 8000
>
> on the backend as a default backend and no server on port 8080.
>
> When I do a request for:
>
> http://varnish_server/foo

And here you are send /foo, which won't match.

> varnishd (varnish-4.1.3 revision 5e3b6d2)

You should also upgrade to 4.1.6 released today.

Dridi



More information about the varnish-misc mailing list