Varnishncsa '%r' format specifier returns the full absolute URL instead of just the path component and query string that follows the domain name. This started happening in 3.0.2. Prior to that it worked as expected. Reproducible: Always Steps to Reproduce: 1. varnishncsa -c -F %r Actual Results: GET http://www.mydomain.com/sample/page/1?layout=print HTTP/1.1 Expected Results: GET /sample/page/1?layout=print HTTP/1.1 We're running Varnish 3.0.2 on x86_64 Gentoo 2.0.3. This messes with log analyzers and could be a show stopper for some users. Of course it would be if the URL path be made available as a format specifier. Since all of the other components are available it would be easy for someone to synthesize the format they need.
After digging around the source I discovered that the '%U' parameter is the URL without the protocol and host portions (ie "/mypage.html" instead of "http://my.domain.com/mypage.html". So I now use "%m %U%q %H" instead of "%r". This could be returned to the old behavior, and what at least seems to be my "normal" experience, by dropping lines 631-637 from the varnishncsa.c file. See attached diff.
Created attachment 299329 [details, diff] Patch to remove protocol and host from %r.
3.0.2 is off the tree and I'm going to be dropping the 3.x series in favor of 4.x. Is this an issue with the 4.x series?
(In reply to Anthony Basile from comment #3) > 3.0.2 is off the tree and I'm going to be dropping the 3.x series in favor > of 4.x. Is this an issue with the 4.x series? I don't know as I haven't had the opportunity to work with 4.x.
varnish 3.x has been EOL since 2015-03-23, sorry but its time to punt it. See http://www.varnish-cache.org/releases/index.html