Hej Christian,
Can you capture a varnishlog please ?
--
Poul-Henning Kamp | UNIX since Zilog Zeus 3.20
p...@freebsd.org | TCP/IP since RFC 956
FreeBSD committer | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
I wanted to know what is the correct syntax to only want to cache Get and Head
if req.method. I used this and O got and error when I checked the syntax.
If (req.method ! = "GET" && req.method ! = "HEAD") {
Return (pass);
}
Does this need to inserted in a particular place
This email
Hi,Christian.
Yes, my backend is Varnish.
Apache did not error by POST request in my test env too.
Probably, C-L is ignored in apache.(I'm not read apache source.)
rfc7230 is written
If a message is received with both a Transfer-Encoding and a
Content-Length header field, the
Actually, Varnish should set the XFF header even before you enter vcl_recv.
--
Guillaume Quintard
On Mar 17, 2017 19:23, "Hernán Marsili" wrote:
> Ok, so I finally make it work with the suggested rule.
>
> On the vcl_recv I have:
>
> if (req.http.x-forwarded-for) {
>
>
Dridi,
I must not be understanding your example on [2] as I'm still getting
everything passed.
The BereqHeader in varnishlog -b shows:
BereqHeaderCookie: JSESSIONID=4A1158EB11C9E93D6AD2A101BB9FA204;
pfmhelp=1; _ga=GA1.2.1694534677.1489779146;
TrackJS=f2465051-cb66-4cfa-8a47-5c7a5d07aab4;
Hi,Christian.
#sorry I forgot add ml-list...
Are you manipulating cookies in Varnish?(set, get...)
Some browser send several cookie header by H/2.
Probably in order to make HPACK compression more effective.
you may want to use std.collect.
I added the this VCL in my environment.
sub vcl_recv{
Hi kokoniimasu,
if(req.http.cookie){
std.collect(req.http.cookie);
set req.http.cookie = regsuball(req.http.cookie,", ","; ");
}
did the trick for me..
Thanks for your help.
The other if only seems to be relevant and valid if the backend is a
varnish too? My backend is
Thanks!
From: Guillaume Quintard [mailto:guilla...@varnish-software.com]
Sent: Friday, March 17, 2017 9:34 AM
To: Rodney Bizzell
Cc: varnish-misc@varnish-cache.org
Subject: Re: load-balancing
The docs have this: http://varnish-cache.org/docs/5.0/reference/vcl.html (you
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256
On 03/17/2017 06:22 PM, Rodney Bizzell wrote:
> I wanted to know what is the correct syntax to only want to cache
> Get and Head if req.method. I used this and O got and error when I
> checked the syntax.
>
> If (req.method ! = “GET” &&
Ok, so I finally make it work with the suggested rule.
On the vcl_recv I have:
if (req.http.x-forwarded-for) {
set req.http.X-Forwarded-For = req.http.X-Forwarded-For + ", " +
client.ip;
set req.http.x-cdn-ip = regsub(req.http.X-Forwarded-For, "([^,]+), *([^
,]+)[ ,]?.*", "\2");
}
Authenticated requests should typically bypass cache, unless you want to
hash the related session id(s), however that can get "interesting". I
suggest using an Apache module such as rpaf or remoteip in order for Apache
to set the client IP from the X-Forwarded-For header set by Varnish. This
way,
Thanks!
From: Nicolas Delmas [mailto:colas.del...@gmail.com]
Sent: Thursday, March 16, 2017 11:42 AM
To: Rodney Bizzell
Cc: varnish-misc@varnish-cache.org
Subject: Re: Setting stale content
Hi,
There the link to the documentation :
Thank you! so, I figure I can parse the x-forwarded-for in which I have 3
ips. The first one is the customer, the second one is the one 1 need (the
CDN) and the third I think is the load balancer.
I can assign it to a new header x-cdn-ip and use apache_remoteip to use
that ip as the connecting
The docs have this: http://varnish-cache.org/docs/5.0/reference/vcl.html
(you are interested in bereq.backend and req.backend_hint) and
http://varnish-cache.org/docs/5.0/reference/vmod_directors.generated.html
And there is a couple of articles about it:
Does the CDN not provide the IP you want in a separate header? Typically
CDN's have custom headers for just that which you can use as well
On Fri, Mar 17, 2017 at 3:31 PM, Guillaume Quintard <
guilla...@varnish-software.com> wrote:
> If you have the ability to compile a vmod, you can use split()
If you have the ability to compile a vmod, you can use split() from
vmod-str (disclaimer: I wrote that)
https://github.com/gquintard/libvmod-str/blob/master/src/vmod_str.vcc
otherwise, to get the second ip, something like :
regsub(req.http.xff, "([^,]+), *([^ ,]+)[ ,]?.*", "\2")
should work.
16 matches
Mail list logo