Code Snippets VCL

Short texts VCL 🧑‍💻 Code snippets VCL ✍️ Reading lists VCL 👀

Lets create a default vcl together

vcl 4.0; //vcl version import std; import directors; import header; import kvstore; backend backendapiniz { .host = “backend hostunuz”; .port = “port no”; .probe = { .url = “/status”; .expected_response = 200; .timeout = 4s; .interval = 5s; .window = 7; .threshold = 2; } } sub vcl_init { new backendapiniz = directors.round_robin(); backendapiniz.add_backend(backendapiniz); } […]

The perfect Varnish configuration for Joomla, WordPress & other CMS based websites

# The perfect Varnish configuration for Joomla, WordPress & other CMS based websites IMPORTANT: Read this before implementing one of the configuration files below (for either Varnish 3.x or 4.x+). USE: Replace the contents of the main Varnish configuration file located in /etc/varnish/default.vcl (root server access required – obviously) with the contents of the configuration […]

The perfect Varnish configuration for Joomla, WordPress & other CMS based websites

# The perfect Varnish configuration for Joomla, WordPress & other CMS based websites IMPORTANT: Read this before implementing one of the configuration files below (for either Varnish 3.x or 4.x+). USE: Replace the contents of the main Varnish configuration file located in /etc/varnish/default.vcl (root server access required – obviously) with the contents of the configuration […]

WordPress-optimised VCL configuration file for varnish.

# This is a WordPress-optimised VCL configuration file for varnish. backend default { .host = “127.0.0.1”; .port = “8080”; .connect_timeout = 600s; .first_byte_timeout = 600s; .between_bytes_timeout = 600s; .max_connections = 800; } sub vcl_recv { set req.http.X-Forwarded-For = client.ip; if (req.http.host != “example.com”) { return(pass); } #never cache POST requests if (req.request == “POST”) { […]

hn support / varnish.vcl

vcl 4.0; import std; # The minimal Varnish version is 4.0 # For SSL offloading, pass the following header in your proxy server or load balancer: ‘X-Forwarded-Proto: https’ backend default { .host = “127.0.0.1”; .port = “8080”; } acl purge { “127.0.0.1”; } sub vcl_recv { if (req.method == “PURGE”) { if (client.ip !~ purge) […]