Varnish the gatekeeper, Rule #1

I know, it just seems too obvious to be worth mentioning, but if I have learned anything from scanning through access log files from a website with 3-digit million requests a day, it is that there is nothing that won’t be thrown your way. So better be safe than sorry and make sure only valid requests are forwarded to your already overwhelmed application servers.

sub vcl_recv {
  if (req.request !~ "(?i)^(HEAD|GET|POST)$") {
    error 405 "Method Not Allowed";
  }
}
About these ads

One thought on “Varnish the gatekeeper, Rule #1

  1. Pingback: Varnish is smarter than you | ops42

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s