Questions tagged [varnish]

Varnish is a high-performance reverse proxy and load-balancer package for Linux/Unix systems.

Varnish is primarily a caching reverse proxy, but also exhibits load-balancing and backend checking mechanisms and is very widely used on high traffic websites.

Varnish was designed from the ground to be a high performance reverse caching proxy and to not compete with the operating system on managing resources like memory. Most recent versions of Varnish support storing cache on memory or disk, and serving old content in case of backend fail (saint mode), among other features.

Varnish is written by Poul-Henning Kamp (PHK), and his Architect Notes are available about varnish design. PHK is also a well known FreeBSD kernel developer and mantainer.

937 questions
0
votes
1 answer

How to bypass varnish cache based on specific header

I've been working on this since 2 days ago, but no luck. So, basically, I want to bypass the varnish cache for a specific incoming request URL. I've defined this rule: sub vcl_recv { if (req.url ~ "/en/reading-books/") { return(pass); } } But…
Budianto IP
  • 141
  • 6
0
votes
1 answer

A proxy forward to redirect some calls to avoid crossing the proxy. Only redirect proxy forward

I'm trying to redirect with 301 some https calls with some proxy forward. The idea is not to go through the proxy, but to return a 301 redirect with the new location. I've got two cases: https://example.com/dummy/copy/this/path ->…
albertoiNET
  • 131
  • 5
0
votes
1 answer

Error 503 service unavailable - varnish,drupal & nginx

We are having a Varnish server which is running in port 6081 and an NGINX server hosting drupal website on another server. So, the VCL file is as below: # Default backend definition. Set this to point to your content server. backend default { .host…
serverstackqns
  • 764
  • 3
  • 16
  • 42
0
votes
1 answer

Varnish 7.2 CLI telnet logs

I upgraded to varnish 7.2 and now it dumps the logs of varnishd into /var/log/messages on Centos 8 and can not figure out how to change the location of its logs! any clue would be appreciated. Here is a sample of the log: varnishd[2327]: CLI telnet…
BJaz
  • 19
  • 5
0
votes
2 answers

is there a way to reference a subnet of an IP address dynamically in VCL *varnish) without creating an ACL on a request by request basis?

like lets say 72.72.72.72 is the client ip and i wanted to compare it to token or a header that had an IP of 72.72.73.72. basically i want to compare if 72.72.72.72 and 72.72.73.72 but dynamically without an ACL. so basically if i give out a token…
Dan
  • 1
  • 1
0
votes
2 answers

How to force SSL on Nginx & Varnish

how can i redirect only to https in Nginx and varnish. I use varnish cache in port 80 and Nginx listening on 8080. Works fine in http, but i need to add SSL. my configuration is as follows server { listen 443 ssl http2 default_server; …
dalan
  • 1
0
votes
1 answer

Pros and Cons of a `.port` backend v. a `.host` backend in Varnish

At work we have a varnish cluster. All the remote backends us the .host value (which I assume is required) but all the configs for the local backend, ie the backend running on the server the config/varnishd is on, use the .path value. This morning I…
Ian Pringle
  • 103
  • 2
0
votes
1 answer

Update request cookie for Varnish ESI-include requests from initial `beresp`

I have an application that is fronted by a Varnish server. Parts of the page is rendered using ESI includes. My problem is that the upstream response includes an encrypted session cookie, which among other things contains a CSRF token (no…
nikc.org
  • 103
  • 4
0
votes
1 answer

Varnish refusing to cache by calling "hit_for_pass"

13 StatSess c 127.0.0.2 48714 0 1 1 0 1 1 687 2573 24 BackendXID b 1374630903 24 TxRequest b GET 24 TxURL b /do_ajax.php?action=get-dom 24 TxProtocol b HTTP/1.0 24 TxHeader b X-Forwarded-Proto: https 24…
Sayaman
  • 187
  • 1
  • 11
0
votes
0 answers

As of this morning varnish is not listening on configured port 80

I've had varnish running on my site for awhile now configured to listen on port 80 and apache on port 8080. This morning I noticed that varnish is now listening on port 6081. When I systemctl restart varnish it still is listening on port 6081. ps…
Timothy Fisher
  • 115
  • 2
  • 7
0
votes
1 answer

varnish cache not working for ajax calls

if (req.url ~ "do_ajax.php" && req.request == "GET") { return (lookup); } I put this line inside the varnish.vcl config, but I get this header in the response header: no-cache, must-revalidate, max-age=0 I also tried with: if (req.url ~…
Sayaman
  • 187
  • 1
  • 11
0
votes
1 answer

How to return banned objects length in varnish purge?

i am Using Varnish 6.0 LTS in debian iam using magento2 vcl 6 from here: https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/PageCache/etc/varnish6.vcl when i issue a curl request with a tag pattern i would like the response to…
aimiliano
  • 101
  • 2
0
votes
1 answer

Varnish 4.1 - How to serve cached copy on backend fetch failed instead of 503

I have a site served by apache+tomcat and a cache served by Varnish 4.1 When apache is down, varnish always returns a 503 error. I would like varnish to return the copy of the pages it has in its cache but my attempts with ttl and grace have been…
Erich
  • 25
  • 3
0
votes
1 answer

How do you log the requests that are not getting a cache hit on varnish?

Made a new theme on Wordpress, the new theme is very similar to the old one, meaning there shouldn't be any major SQL queries change, probably less, but the website is slow and it seems it comes from varnish. How do I debug varnish to see which…
Sayaman
  • 187
  • 1
  • 11
0
votes
1 answer

How to distribute Varnish cache differently to different kind of requests?

I have a redirect in my store that shows a different store view based on the client's location. It reads the header via Fastly and redirects the customer to a different store view using every time the same URL. When there are many customers…