Dev/Varnish
From Whonix
< Dev
.
Contents
- 1 Varnish Cheat Sheet
- 1.1 Show most requested URLs from backend
- 1.2 Show specific requested URLs from backend
- 1.3 Show requests for single URL
- 1.4 Show backend responses
- 1.5 HTTP Purges
- 1.6 Show HTTP requests
- 1.7 Show HTTP purges
- 1.8 Ban single URL
- 1.9 Ban all URLs
- 1.10 Show how many connections are currently open
- 1.11 wordpress Total Cache varnish setup
- 1.12 list of all variables such as client.ip
- 1.13 default built-in vcl
- 1.14 Show nuked items
- 2 whonix.org
- 3 varnish advantages
- 4 Feature Requests
- 5 Debugging
Varnish Cheat Sheet[edit]
For Varnish 4.
Show most requested URLs from backend[edit]
varnishtop -i BereqURL
Show specific requested URLs from backend[edit]
varnishlog -q 'BereqURL ~ "^/forum/Themes/default/scripts/"
Show requests for single URL[edit]
varnishlog -q 'ReqURL ~ "^/wiki/Translatetest"'
Show backend responses[edit]
varnishlog -g request -q "RespStatus eq 503"
varnishlog -g request -q "BerespStatus eq 503"
HTTP Purges[edit]
curl -X "PURGE / HTTP/1.0" 127.0.0.1:6081/adrelanos.asc
or: curl --head -X "PURGE / HTTP/1.0" 127.0.0.1:6081/adrelanos.asc
check (Resets Age in http header to 0.): curl --head https://www.whonix.org/adrelanos.asc [archive]
Show HTTP requests[edit]
varnishlog -q "ReqMethod eq PURGE"
Show HTTP purges[edit]
varnishlog -q "VCL_return eq purge"
Ban single URL[edit]
varnishadm 'ban req.url ~ "/adrelanos.asc"'
varnishadm 'ban req.url ~ "/wiki/Translatetest"'
Ban all URLs[edit]
varnishadm 'ban req.url ~ "."'
Show how many connections are currently open[edit]
netstat -anp | grep :443 | grep ESTABLISHED | wc -l
wordpress Total Cache varnish setup[edit]
wordpress → Performance (on the side) → General Settings → Reverse Proxy
127.0.0.1:6081
run in shell: varnishlog -q "VCL_return eq purge"
test: wordpress → Performance (at the top) → empty all cache
list of all variables such as client.ip[edit]
https://www.varnish-cache.org/docs/trunk/reference/vcl.html [archive]
default built-in vcl[edit]
https://www.varnish-cache.org/trac/browser/bin/varnishd/builtin.vcl?rev=4.0 [archive]
Show nuked items[edit]
Elements that have been removed from cache due to lack of memory.
varnishstat -1 -f MAIN.n_lru_nuked
whonix.org[edit]
/etc/default/varnish
## Patrick: changed from ## -s malloc,256m ## to ## -s malloc,8G
varnish advantages[edit]
- devicedetect.vcl [archive] for mobile devices for mediawiki
Feature Requests[edit]
Debugging[edit]
- https://www.whonix.org/wiki/Main_Page?action=purge [archive]
- see if purge request is registered
- https://www.mediawiki.org/wiki/Manual:Purge [archive]
Whonix ™ is Supported by Evolution Host DDoS Protected VPS. Stay private and get your VPS with Bitcoin or Monero.
Want to make Whonix safer and more usable? We're looking for helping hands. Check out the Open Issues [archive] and development forum [archive].
https [archive] | (forcing) onion [archive]
This is a wiki. Want to improve this page? Help is welcome and volunteer contributions are happily considered! Read, understand and agree to Conditions for Contributions to Whonix ™, then Edit! Edits are held for moderation.
Copyright (C) 2012 - 2019 ENCRYPTED SUPPORT LP. Whonix ™ is a trademark. Whonix ™ is a licensee [archive] of the Open Invention Network [archive]. Unless otherwise noted, the content of this page is copyrighted and licensed under the same Freedom Software license as Whonix ™ itself. (Why?)
Whonix ™ is a derivative of and not affiliated with Debian [archive]. Debian is a registered trademark [archive] owned by Software in the Public Interest, Inc [archive].
Whonix ™ is produced independently from the Tor® [archive] anonymity software and carries no guarantee from The Tor Project [archive] about quality, suitability or anything else.
By using our website, you acknowledge that you have read, understood and agreed to our Privacy Policy, Cookie Policy, Terms of Service, and E-Sign Consent. Whonix ™ is provided by ENCRYPTED SUPPORT LP. See Imprint.