Questions tagged [varnish]
Varnish is a high-performance reverse proxy and load-balancer package for Linux/Unix systems.
937
questions
0
votes
1
answer
104
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 ...
0
votes
2
answers
174
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 ...
0
votes
1
answer
111
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) {
...
0
votes
1
answer
121
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, ...
0
votes
1
answer
277
views
Configure Cloudflare with varnish
We want to configure the varnish in the following way:
Local IP --> Varnish --> Cloudflare --> AWS
Is it possible?
0
votes
1
answer
68
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 ...
0
votes
2
answers
55
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 ...
1
vote
1
answer
162
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 ...
0
votes
1
answer
90
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 ...
0
votes
1
answer
666
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 ~...
0
votes
1
answer
314
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://...
0
votes
1
answer
387
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 ...
0
votes
1
answer
48
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 ...
1
vote
2
answers
3k
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...
...
1
vote
1
answer
62
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 ...
0
votes
2
answers
199
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 ...
0
votes
2
answers
863
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 {
...
0
votes
1
answer
53
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/...
2
votes
2
answers
3k
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 ...
0
votes
1
answer
177
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 ...
0
votes
1
answer
235
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 ...
0
votes
0
answers
313
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 ...
0
votes
1
answer
294
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:...
0
votes
1
answer
147
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 ...
0
votes
1
answer
700
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 ...
0
votes
1
answer
472
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 ...
0
votes
1
answer
105
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 ...
0
votes
1
answer
42
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....
0
votes
2
answers
516
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>
...
0
votes
1
answer
164
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 ...
0
votes
1
answer
647
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 ...
0
votes
1
answer
171
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
...
0
votes
1
answer
425
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 ...
1
vote
1
answer
1k
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-...
0
votes
1
answer
388
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 ...
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 ...
0
votes
0
answers
172
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 ...
0
votes
1
answer
1k
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 ...
0
votes
1
answer
733
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 ...
0
votes
1
answer
149
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 ...
0
votes
1
answer
145
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 ...
0
votes
0
answers
512
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 ...
0
votes
0
answers
714
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 ...
0
votes
0
answers
104
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 ...
0
votes
1
answer
32
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:...
0
votes
1
answer
321
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 ...
0
votes
1
answer
691
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. ...
-1
votes
1
answer
300
views
Docker Swarm and load-balancing of Varnish persistent TCP connections (VIP)
I have a Varnish HTTP cache running in front of 40 workers. These workers are running on two identical Docker nodes (node-1 and node-2, 20 on each) as a unique service (web_workers). We're using ...
1
vote
2
answers
2k
views
Varnish not keeping cache for more than a few minutes
I am running a Magento 2 site that is going very slow because Varnish will not keep it's cache for more than a few minutes. Here is the default.vcl file:
# VCL version 5.0 is not supported so it ...
0
votes
0
answers
33
views
I can't install locales due to varnish cache
We're having locale issues on a server, but if I am to install locales it will uninstall varnish.
It's Debian 8 and a test system, so nothing in production will be affected.
Is there a way to install ...