Returning HTTP 204 for OPTIONS requests

Lasse Karstensen lkarsten at varnish-software.com
Tue Sep 22 09:29:33 CEST 2015


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



More information about the varnish-misc mailing list