cloudsidedev / appside

Multitenant environment automation.
http://cloudside.ch
GNU Affero General Public License v3.0
38 stars 7 forks source link

Varnish: Add support for cache bans #73

Closed ocean90 closed 7 years ago

ocean90 commented 7 years ago

Example: curl -X PURGE -H "Host: example.org" -H "X-Forwarded-Proto: https" -H "X-Forwarded-Proto: https" -H "X-Purge-Method: regex" 127.0.0.1:6081/something/.*

Docs: https://www.varnish-cache.org/docs/3.0/tutorial/purging.html#bans

See #47.

ocean90 commented 7 years ago

To check existing bans you can use varnishadm:

sudo varnishadm
200
-----------------------------
Varnish Cache CLI 1.0
-----------------------------
Linux,3.13.0-98-generic,x86_64,-smalloc,-smalloc,-hcritbit
varnish-3.0.5 revision 1a89b1f

Type 'help' for command list.
Type 'quit' to close CLI session.

varnish> ban.list
200
Present bans:
1492606003.613166     2     obj.http.X-Req-URL ~ /something/.* && obj.http.X-Req-Host == example.org
ivomarino commented 7 years ago

great, thanks @ocean90