I'm in the early stages of testing Varnish 3.0.4 as a new front end for a web service. I have varnish configured to listen on port 88. For its backend it's using an existing apache server running on the same host on port 80.
The trouble I'm having is that when varnish makes a request to apache, it's including ":88" in the Host
http header (even though it's definitely connecting to apache on port 80.
For example:
- I request
http://www.myservice.com:88/images/foo.gif
. It makes a request to the backend. - The apache backend logs the
HOST
header to the Apache access log - using%{Host}
in the log file format - The access log shows this host header as
www.myservice.com:88
, notwww.myservice.com
.
If I connect to this apache server with telnet and make identical HEAD requests but altering the value of the Host
header, I see the same behavior that I witness through varnish - i.e. if I include the :88 in the host header, the request returns 404.
I've tried:
- altering
req.http.header.port
andberesp.http.header.port
to80
- altering
req.http.header.host
andberesp.http.header.host
towww.myservice.com
.
Seems like I'm missing something obvious.
How do I get varnish to send a proper Host header to apache?