Issue with varnish passing absolute url to backend

Michael Alger varnish at mm.quex.org
Tue Feb 8 05:40:32 CET 2011


On Tue, Feb 08, 2011 at 03:27:02PM +1100, Thiago Figueiro wrote:
> From Michael Alger:
> 
> > This is the normal format for an HTTP request. The most basic level
> > looks like:
> >
> > GET /username HTTP/1.0
> > Host: test.example.com
> >
> > You will only see requests in the form of
> >
> > GET http://test.example.com/username HTTP/1.0
> > Host: test.example.com
> >
> > if the request is being made via a proxy, i.e. if the user-agent
> 
> The "Host" header is part of the HTTP/1.1 implementation.

Most current UAs which send HTTP/1.0 requests include the Host
header, although I believe you're right in that it's only actually
required in HTTP/1.1. But there's lots of services that rely on the
Host header, because that's the only available method for having
multiple sites on the same IP/port combination.

I did consider mentioning that the host header was optional but
figured it would just confuse things, and requests without the host
header are rarely seen in the wild to the best of my knowledge.
(Doesn't mean you shouldn't be prepared to handle such requests, of
course.)

> All HTTP/1.0 requests will be in the above format, made via a
> proxy or not.

http://www.w3.org/Protocols/HTTP/1.0/spec.html#Request-URI

    Request-URI    = absoluteURI | abs_path

  The two options for Request-URI are dependent on the nature of the
  request. 

  The absoluteURI form is only allowed when the request is being made
  to a proxy.

The Host header was added to the spec precisely because the origin
server had no way of determining what host the client thought it was
speaking to.




More information about the varnish-misc mailing list