Returning HTTP 204 for OPTIONS requests

Andrew Langhorn andrew.langhorn at digital.cabinet-office.gov.uk
Tue Sep 22 10:05:31 CEST 2015


Upgrading Varnish is on the to-do list. I had issues with using that
snippet in vcl_recv when introducing a beresp statement - am I right in
thinking that beresp is only available from vcl_fetch?

Thanks Lasse.

On Tuesday, 22 September 2015, Lasse Karstensen <
lkarsten at varnish-software.com> wrote:

> On Wed, Sep 16, 2015 at 12:36:36PM +0100, Andrew Langhorn wrote:
> > I run Varnish in front of a stack that doesn't respond to OPTIONS
> requests.
> > I'd like to filter out these requests from our error logs, because
> > currently they respond with a 404, which means there's quite a lot of
> noise.
> > I've been using this snippet at the top of vcl_recv:
> > if (req.request == "OPTIONS") {
> > error 204 "No Content";
> > }
> > Is that the best place for it, or are there better places instead?
> > Similarly, is that the best way of doing this?
>
> Yes, this is the best way of doing this.
>
> You should consider upgrading to Varnish 4.0 (or 4.1!), since 3.0
> was declared end of life in April 2015.
>
> --
> Lasse Karstensen
> Varnish Software AS
>


--
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20150922/cce70337/attachment.html>


More information about the varnish-misc mailing list