Skip to main content

Questions tagged [varnish]

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

Filter by
Sorted by
Tagged with
0 votes
1 answer
190 views

ETag-based content revalidation

My CMS generates pretty complex pages and thus takes a little while to do so (about 2 seconds), which is well above my time budget to serve pages to the client. However it's very cheap for me to know ...
Xowap's user avatar
  • 153
-1 votes
1 answer
213 views

Client 443/HTTPS -> Virtual IP -> HA Proxy 80/HTTP and 443/HTTPS SSL terminaison -> Varnish 81/HTTP -> 82/HTTPS and 442/HTTPS Apache

At home, I have 1 hosted server with some websites, using Virtualmin (great tool!) and everything is working fine with HTTPS, HTTP...even behind my internet router, using NAT by forwarding ports 80 ...
kiminox's user avatar
0 votes
2 answers
334 views

Varnish. How to redirect based on locale with cookie?

I need to implement cookie-based redirection logic for a multilingual site. I have working code for the Next.js middleware, but unfortunately it doesn't work in a standalone setup with Docker (I don't ...
Predaytor's user avatar
0 votes
1 answer
566 views

How to setup Nginx and Varnish reverse proxy for Node.js?

My website on the Astro framework (Node.js SSR adapter) is deployed on 1 shared-cpu-1x@256MB fly.io instance in the Amsterdam region, which automatically handling gzip, TSL termination. Initial setup ...
Predaytor's user avatar
0 votes
2 answers
733 views

How to install varnish cache in Amazon Linux 2023?

I want to install varnish cache 6 in Amazon Linux 2023. Sudo dnf install varnish Above command returns no packages found message. Tried with direct rpm package installation but it failed to resolve ...
Duke's user avatar
  • 123
0 votes
1 answer
281 views

What does this block of varnish code do?

I have this code in varnish config and not sure what it do! This config will cache or not my client requests? what is wrong with it? sub vcl_backend_response { if (beresp.status != 200) { ...
Morteza's user avatar
0 votes
1 answer
356 views

Configure varnish with cloudflare along with SSL terminator

Our present scenario: Present Scenario Now, we are planning to create a cache server between the user and the site. Proposed Plan As per my understanding, cache servers can't work with HTTPs data. So, ...
Riad Reza Shuvo's user avatar
0 votes
1 answer
1k views

Configure Cloudflare with varnish

We want to configure the varnish in the following way: Local IP --> Varnish --> Cloudflare --> AWS Is it possible?
Riad Reza Shuvo's user avatar
0 votes
1 answer
213 views

How to force Varnish stale whole content

We have a website which is fairly large. we update content every week but it is fine to serve stale for the first visit after updating backend content. Therefore we dont want to ban or purge whole ...
Tung's user avatar
  • 1
0 votes
2 answers
85 views

Varnish 6 bans_persisted_bytes ballooning, but memory usage is fine

In a Varnish 6 server I'm responsible for, there are short bursts of very many bans. These are the result of an application I am not able to modify. This has caused RAM usage to very quickly balloon ...
Toon Spin's user avatar
1 vote
1 answer
206 views

Magento2 website with nginx(with SSL termination) and varnish cache

I have hosted Magento2 website with Nginx, SSL termination, and Varnish cache. Varnish cache is running on port 8080 and the Magento2 website is hosted on Nginx port 8081. Http and Https traffic is ...
timg's user avatar
  • 11
0 votes
1 answer
207 views

Varnish - detach and attach cookies

First of all, I'm asking to find out whether this is possible or not. So, I can see Varnish will not cache objects if it has cookies. I'm thinking about when an incoming request has cookies, Varnish ...
Budianto IP's user avatar
0 votes
1 answer
2k views

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 ~...
Budianto IP's user avatar
0 votes
1 answer
488 views

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://...
albertoiNET's user avatar
0 votes
1 answer
565 views

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 ...
serverstackqns's user avatar
0 votes
1 answer
65 views

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 ...
BJaz's user avatar
  • 19
1 vote
2 answers
7k views

Varnish + nginx 503 error backend fetch failed

some assistance would be appreciated. My setup: LB -> VARNISH -> NGINX For reasons unknown, I started getting random error 503 on the clients. I've checked the logs on varnish and Nginx... ...
zerocool's user avatar
1 vote
1 answer
121 views

How do I create Varnish cache objects for certain pages without a "first user"?

We have some pages that take forever to load and are not hit very often. If we set set beresp.ttl = 5d; for those pages in the .vcl file, how can we also force a new cached object, so that object is ...
iateadonut's user avatar
0 votes
2 answers
356 views

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 ...
Dan's user avatar
  • 1
0 votes
2 answers
1k views

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 { ...
dalan's user avatar
  • 1
0 votes
1 answer
76 views

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/...
Ian Pringle's user avatar
2 votes
2 answers
4k views

How to implement caching of HTTP responses in Kubernetes?

How can I cache HTTP responses from my services in Kubernetes? I have a simple web service in my cluster and am wondering how I could cache static assets (static html, images, fonts, etc.) beyond ...
nfelger's user avatar
  • 121
0 votes
1 answer
262 views

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 ...
nikc.org's user avatar
  • 103
0 votes
1 answer
285 views

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 ...
Sayaman's user avatar
  • 197
0 votes
0 answers
449 views

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 ...
Timothy Fisher's user avatar
0 votes
1 answer
395 views

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:...
Sayaman's user avatar
  • 197
0 votes
1 answer
202 views

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 ...
aimiliano's user avatar
  • 101
0 votes
1 answer
976 views

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 ...
Erich's user avatar
  • 25
0 votes
1 answer
786 views

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 ...
Sayaman's user avatar
  • 197
0 votes
1 answer
136 views

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 ...
Rafael Corrêa Gomes's user avatar
0 votes
1 answer
54 views

Determining if varnish config changes are needed after adding 3 new cookies

# Keep all these cookie if (req.http.Cookie) { set req.http.Cookie = ";" + req.http.Cookie; set req.http.Cookie = regsuball(req.http.Cookie, "; +", ";"); set req....
Sayaman's user avatar
  • 197
0 votes
2 answers
709 views

apache behind varnish; htaccess deny rules ignored

So, I have a wordpress website running behind nginx -> varnish -> httpd The htaccess rule for wp-login.php is set as: <Files wp-login.php> allow from client ip deny from all </Files> ...
iraqiboy90's user avatar
0 votes
1 answer
190 views

Varnish sometimes (up to ~5% of the requests) triggers err_too_many_redirects, running in docker combined with plesk for wordpress [closed]

We've followed these instructions https://support.plesk.com/hc/en-us/articles/115001888894-Does-Plesk-support-Varnish- and were able to get it to work 'properly', it serves the wordpress site through ...
Remco van Grinsven's user avatar
0 votes
1 answer
895 views

401 Authorization Required on Apache 2.2 when curling leads to 500 varnish error

[centos@staging03 ~]$ sudo netstat -plnt Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp ...
Sayaman's user avatar
  • 197
0 votes
1 answer
216 views

"FetchError no backend connection" error when Apache is running

[centos@ip-172-35-25-65 ~]$ varnishlog 0 CLI - Rd ping 0 CLI - Wr 200 19 PONG 1635280998 1.0 0 CLI - Rd ping 0 CLI - Wr 200 19 PONG 1635281001 1.0 ...
Sayaman's user avatar
  • 197
0 votes
1 answer
698 views

Varnish seems to not be using my `file` storage configuration

I've configured Varnish to use a file storage. Varnish seems to be working, but the cache seems to be a fraction of the size I've specified and the file I've specified for the storage does not seem to ...
Jordan Eldredge's user avatar
1 vote
1 answer
2k views

Varnish with Basic auth returns 401

I've tried to configure Varnish on server which has Basic Auth authentication by using these solutions: https://stackoverflow.com/a/40424168/7202171 https://blog.tenya.me/blog/2011/12/14/varnish-http-...
Major Kuprich's user avatar
0 votes
1 answer
551 views

Is there a way to write the query parameters as cookie in nginx

I would like to ask if there's a way to set the query parameters as the cookie of a certain url? Currently i'm having trouble with the varnish and nginx cause it was stripping the utm params which ...
machii28's user avatar
0 votes
1 answer
1k views

Varnish doesn't open backend connection

How can I connect Varnish container with PHP-FPM + NGINX containers? Docker started correctly, site works but backendopen logs are empty. Backend is healthy (returns HTTP 200 status). varnishlog -g ...
Major Kuprich's user avatar
0 votes
0 answers
223 views

Varnish probe thinks web is down if he gets 103 http code

This is my first post in this forum and I will say that I am sorry for all the mistakes that I will make in this post. This is a desperate call for help as I was not able to find any kind of ...
Micu.s Electrobang's user avatar
1 vote
1 answer
2k views

Easiest Way to Temprarily Disable Varnish Cache (varnishadm)

What is the easiest way to tell varnish: Hey Varnish processes, please clear your cache. And also please don't cache anything at all right now. I want you to just pass all requests straight to the ...
Michael Altfield's user avatar
0 votes
1 answer
979 views

Prevent varnish from caching cookie response

When varnish returns a cache, does it also return the cookie generated on the backend or only the css, images and html returned to the frontend? I had users tell me that they kept getting the wrong ...
Sayaman's user avatar
  • 197
0 votes
1 answer
185 views

cancel varnish cache so that it goes to the backend on the homepage only

if (req.url == "/") { return(pass); } Does this allow us to cancel the varnish only on the homepage (ex: www.prism.com) and not other pages like www.prism.com/product? I was thinking this ...
Sayaman's user avatar
  • 197
0 votes
1 answer
188 views

Can varnish serve from a port and clone the request to another port?

I have a problem to solve in my current deployment. The current one looks like this. Varnish on port 80 in front of Nginx on port 8000 backed by uWSGI The problem here is, The client want to implement ...
Rivadiz's user avatar
  • 103
0 votes
0 answers
572 views

Cache Images centrally

Application: Serve responsive and optimized images on the fly by cropping/resizing/compressing master images Current Load: 10k request per minute, ~60MBps traffic. Current Config : NginxPlus LB sits ...
Holy_diver's user avatar
0 votes
0 answers
961 views

Failed to restart varnish.service: Unit not found

[root@server21 ~]# service varnish restart Redirecting to /bin/systemctl restart varnish.service Failed to restart varnish.service: Unit not found. This worked like 3 days ago, but today it stopped ...
Sayaman's user avatar
  • 197
0 votes
0 answers
130 views

Varnish caching issue in the 'Add to cart' section ,,, Drupal,Nginx,Php-Fpm

We are running an ecommerce site configured by drupal with nginx & php-fpm. We also use memcached with mysql database.The service was running smoothly before we enabled the varnish caching. After ...
Md. Shahriar Hossain's user avatar
0 votes
1 answer
42 views

Disable dynamic logging

Message from syslogd@dev01 at Jun 18 09:23:49 ... varnishd[8318]: no cookie Message from syslogd@dev01 at Jun 18 09:23:49 ... varnishd[8318]: no cookie Message from syslogd@dev01 at Jun 18 09:23:...
Sayaman's user avatar
  • 197
0 votes
1 answer
433 views

How do you let a call through in varnish when a cookie "lang" is not set?

How do you let a call through in varnish when a cookie "lang" is not set? I want to let a call go through and not return the cache when the cookie "lang" is set and send the ...
Sayaman's user avatar
  • 197
0 votes
1 answer
785 views

Varnish cache in nginx reverse proxied WHM [closed]

We have our production server with latest cpanel version "96.0 (build 8)" and it is running nginx with reverse proxy enabled. See the netstat screenshot attached for detailed information. ...
nisamudeen97's user avatar

1
2 3 4 5
19