Last active
October 14, 2017 01:09
-
-
Save mauricios/696b5fe8f8817e4b4946d616516586ce to your computer and use it in GitHub Desktop.
Varnish useful commands
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Check configuration file | |
sudo varnishd -C -f /path/to/default.vcl -p vcl_dir=/path/to/vcl_dir | |
# Ban/Purge a URL | |
sudo varnishadm "ban req.http.host ~ ^<hostname>$ && req.url ~ ^<url>$" | |
# Change configuration | |
## Show list of configurations | |
sudo varnishadm "vcl.list" | |
## Show configuration | |
sudo varnishadm "vcl.show <config>" | |
## Load new configuration | |
sudo varnishadm "vcl.load <config> default.vcl" | |
## Verify new configuration | |
sudo varnishadm "vcl.show <config>" | |
## Use new configuration | |
sudo varnishadm "vcl.use <config>" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment