0
votes

I would like to ask you how in varnish code pass requests to the backend without caching. I know that I can do and it is working :

    if (req.url ~ "(\?|&)(something|something|something)=") 
    { 
     return (pass);
    }

but how I can choose backend server for non-caching ?

I have defined couple of backends definition in varnish configuration but I don't know how to set backend servers.

Some opinion (of course it is not working )

if (req.url ~ "(\?|&)(something|something|something)=") 
{ 
 set req.backend_pass = java_backends ;
}

my varnish version is : 4.0

Thanks a lot

1

1 Answers

2
votes

What you want is:

if (req.url ~ "(\?|&)(something|something|something)=") 
{ 
  set req.backend_hint = java_backends;
  return(pass);
}