Is there a way to force exit vcl_recv?

Eyal Marantenboim eyal.marantenboim at storecast.de
Mon Sep 11 08:52:17 UTC 2017


Hi,

We are trying to have varnish respond to all OPTIONS method requests. These
requests should not go to any backend. They should return the CORS headers
with an empty body, always (cors headers are added in vcl_deliver).

Our problem is that, because of the logic that follows in the config,
Varnish still ends up picking a backend and adding body, etc.

I would like to avoid adding everywhere 'if req.method != OPTIONS'..

Is there a way in vcl_recv to do something like this:

if (req.method ~ "(OPTIONS)"){
// dont pick backend, finish vcl_recv processing and jump directly to
vcl_deliver
}

?

Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20170911/7f829df1/attachment.html>


More information about the varnish-misc mailing list