Questions tagged [varnish-4]
180 questions
2
votes
1 answer
Varnish: Making each API keys objects cache separately
I have Varnish 4 installation where I select a backend based on an API-key in the header of each request, such as (we are in vcl_recv):
if (req.url ~ "/content") {
# Check for presence of X-Api-Key header
if ((! req.http.X-Api-Key) || ((!…

Niels2000
- 4,027
- 3
- 16
- 15
2
votes
1 answer
Varnish 4 VCL - Strip defined query string parameters
I'm currently using Varnish 4 as a reverse proxy cache on a website. However I noticed that when a url is called with query string parameters it bypasses the varnish cache.
For example:
www.mywebsite.com = Cache HIT
www.mywebsite.com?gclid=123 =…

Ian
- 21
- 1
- 2
2
votes
2 answers
Varnish never sending If-Not-Modified
I'm trying to use varnish to cache rpms and other giant binaries. What I would've expected is that when an object is expired in the cache varnish would send a request with If-Not-Modified to the backend and then assuming the object didn't change,…
user2475269
2
votes
0 answers
vanish cache not starting up due to file storage parameter
I have varnish 4.0 installed on my centos 7 box my params file looks…

Xavier Fox
- 61
- 1
- 7
2
votes
2 answers
Varnish VCL: how can I switch on req.backend_hint?
I have the following VCL:
vcl 4.0;
import std;
import directors;
backend one {
.host = "localhost";
.port = "3333";
}
backend two {
.host = "localhost";
.port = "3333";
}
sub vcl_init {
new random_director =…

tadasajon
- 14,276
- 29
- 92
- 144
2
votes
0 answers
Varnish VCL - how can I examine req.backend_hint?
I have the following VCL file:
vcl 4.0;
import std;
import directors;
backend one {
.host = "localhost";
.port = "3333";
}
backend two {
.host = "127.0.0.1";
.port = "3334";
}
sub vcl_init {
new random_director =…

tadasajon
- 14,276
- 29
- 92
- 144
2
votes
2 answers
Get varnish to proxy and not redirect
I want to use Varnish as a "smart" proxy and it almost works. The idea is that some requests should be passed through Varnish, hit the backend and return, all other requests should return a "synt" message that the specific response contains no…

Jensd
- 7,886
- 2
- 28
- 37
2
votes
1 answer
Nginx with varnish error: failed (24: Too many open files)
I am running varnish with nginx as proxy on ubuntu and I am getting (24: Too many open files) error every few days.
Restarting nginx solves the problem.
After researching about this error I found that the common solution is to increase…

guyyug
- 897
- 1
- 11
- 23
2
votes
0 answers
Varnish on Nginx not working
I am trying to configure Varnish on Nginx web server.
Varnish Configuration
In the file /etc/varnish/default.vcl
vcl 4.0;
backend default {
.host = "127.0.0.1";
.port = "8080";
}
sub vcl_recv {
}
sub vcl_backend_response {
set…

Joe
- 21
- 2
2
votes
1 answer
Drupal 7 & Varnish 4 - I always get X-Drupal-Cache: MISS but X-Cache: HIT
I have run into the same issue as this person: X-Drupal-Cache for Drupal 7 website always hits MISS, and can not find a way out.
I am running Drupal 7 - Pressflow
and
Varnish 4.0
When I curl I get this result:
TTP/1.1 200 OK
Date: Fri, 08 Jul 2016…

Charlie Brown
- 21
- 2
2
votes
1 answer
How to set up varnish 4.1.2 with multiple apache virtual hosts?
I’m trying to set up Varnish and Apache to serve multiple websites from one VPS. However, when I enter seconddomain.nl in a browser, I am redirected to the default apache2 start page (with a url that is the VPS IP address). However, firstdomain.nl…

Flobin
- 626
- 1
- 10
- 26
2
votes
1 answer
Varnish 4 rewrite URL transparently
I am looking after a website that is currently running a pretty standard varnish/apache set up. The client needs to add a new domain that transparently serves from a path/query string in order to create a lightweight version of their site. For…

Felix
- 159
- 1
- 9
2
votes
1 answer
Varnish: How to use `std.ip()` to set a header value
I am trying to use std.ip which is a part of varnish 4.0 to to return the client IP which should be the first valid IP address in the X-Forwarded-For header, if the example in the documentation is correct.
varnishtest "Test v4 vcl X-Forwarded-For…

Matt
- 5,028
- 2
- 28
- 55
2
votes
1 answer
Varnish VCL "Symbol not found: std.querysort"
I am copying some VCL rules from this handy template and running on the latest stable Varnish4. However this section of the VCL:
vcl 4.0;
sub vcl_init {
# ...
# Normalize query arguments
set req.url = std.querysort(req.url);
}
…

NoChecksum
- 1,206
- 1
- 14
- 31
2
votes
1 answer
Getting random "http first read error: EOF" errors in varnish
I'm seeing the following 503 error in varnish from time to time in the logs:
* << BeReq >> 213585014
- Begin bereq 213585013 fetch
- Timestamp Start: 1452675822.032332 0.000000 0.000000
- BereqMethod GET
- BereqURL …

jayanth
- 110
- 1
- 9