diff --git a/README.md b/README.md index a9b6f50..9ba8fef 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,9 @@ Varnish URL supports multiple servers, separate with comma. E.g `http://1.1.1.1, ``` UPPER_DRIVER=varnish VARNISH_URL= +VARNISH_BAN_KEY= ``` +`VARNISH_BAN_KEY` lets you specify a unique id which you can pick up in your VCL and issue the correct bans. Very useful when you have multiple sites hosted on the same backends and you want to control what to ban. ### Tuning diff --git a/src/drivers/Varnish.php b/src/drivers/Varnish.php index b9da0ec..30c076a 100644 --- a/src/drivers/Varnish.php +++ b/src/drivers/Varnish.php @@ -76,6 +76,7 @@ public function purgeUrls(array $urls) */ public function purgeAll() { + $this->headers['Varnish_Ban_Key'] = getenv('VARNISH_BAN_KEY'); return $this->sendPurgeRequest([ 'headers' => $this->headers ], 'BAN');