Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 393683

Summary: www-servers/varnish-3.0.2 log '%r' format specifier returns the wrong info
Product: Gentoo Linux Reporter: jon
Component: Current packagesAssignee: Anthony Basile <blueness>
Status: RESOLVED OBSOLETE    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Patch to remove protocol and host from %r.

Description jon 2011-12-08 22:41:27 UTC
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.
Comment 1 jon 2012-01-19 19:16:39 UTC
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.
Comment 2 jon 2012-01-19 19:17:40 UTC
Created attachment 299329 [details, diff]
Patch to remove protocol and host from %r.
Comment 3 Anthony Basile gentoo-dev 2016-02-12 01:33:02 UTC
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?
Comment 4 jon 2016-02-12 01:36:22 UTC
(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.
Comment 5 Anthony Basile gentoo-dev 2016-07-10 18:06:45 UTC
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