Ticket #1255 (closed defect: fixed)

Opened 3 years ago

Last modified 22 months ago

Incorrect URL constructed for requests with an absolute URI in the request line

Reported by: tstarling Owned by: phk
Priority: normal Milestone:
Component: build Version: trunk
Severity: normal Keywords:


According to RFC 2616 section 5.1.2:

"To allow for transition to absoluteURIs in all requests in future versions of HTTP, all HTTP/1.1 servers MUST accept the absoluteURI form in requests, even though HTTP/1.1 clients will only generate them in requests to proxies."

This handy property of HTTP is commonly used to route requests to the desired server in a cluster, by setting the HTTP proxy parameter in a client such as cURL or LWP. Varnish does not follow this specified behaviour in some respects.

If I send such a request to a Varnish 3.0.3 server, for example with:

curl -x varnish:80  http://upload.wikimedia.org/foo

varnishncsa reports a log entry with a URL of


That is, the protocol and host header are simply concatenated to the request URI, whether it is absolute or not.

The request appears to be forwarded correctly to the backend, but the bug does break purging:


See the terrible hackish workaround we implemented to allow purging from an LWP client:


Change History

comment:1 Changed 3 years ago by phk

  • Owner set to phk

comment:2 Changed 3 years ago by Poul-Henning Kamp <phk@…>

In [2bbb032bf67871d7d5a43a38104d58f747f2e860]:

Split absolute URIs into URL and Host: as per RFC2616 5.2

Fixes #1255

comment:3 Changed 3 years ago by Poul-Henning Kamp <phk@…>

  • Status changed from new to closed
  • Resolution set to fixed

(In [2bbb032bf67871d7d5a43a38104d58f747f2e860]) Split absolute URIs into URL and Host: as per RFC2616 5.2

Fixes #1255

Note: See TracTickets for help on using tickets.