Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
freekmurze committed Dec 9, 2016
1 parent e1b36c9 commit 54eba43
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions config/laravel-varnish.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@
'hosts' => [

],

'secret' => '/etc/varnish/secret',

'administrative_port' => 6082,
];
4 changes: 3 additions & 1 deletion src/Varnish.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ protected function generateFlushCommand(array $hosts): string
})
->implode('|');

return "sudo varnishadm -S /etc/varnish/secret -T 127.0.0.1:6082 'ban req.http.host ~ {$hostsRegex}'";
$config = config('laravel-varnish');

return "sudo varnishadm -S {$config['secret']} -T 127.0.0.1:{$config['administrative_port']} 'ban req.http.host ~ {$hostsRegex}'";
}

/**
Expand Down

0 comments on commit 54eba43

Please sign in to comment.