All calls redirecting to backend port

Rangel, Raul Raul.Rangel at
Mon Mar 25 18:41:43 CET 2013

You need to make sure your application support being behind a reverse proxy. Two solutions I can think of to your problem are 1) Make all urls relative. i.e) /mypage.php?item=1234 instead of using the full url. 2) Have varnish append a X-Forwarded-Host header in vcl_recv. Then make your app use that as the host for the urls.


From: varnish-misc-bounces at [mailto:varnish-misc-bounces at] On Behalf Of Mike Noren
Sent: Monday, March 25, 2013 11:07 AM
To: varnish-misc at
Subject: All calls redirecting to backend port

Hello all,
I'm completely new to Varnish, if this is a silly question I apologize and ask to please be directed to a newbie forum.

Anyway, I've a LAMP server on which I'm testing Varnish. Apache is set to port 8008 in ports-conf and 000-default, Varnish is set to listen on port 80 in /etc/default/varnish and told that the backend is on port 8008 in default.vcl.

Everything seems to be working, Varnishhist and Live Headers confirm that Varnish is caching the frontpage, but clicking on any link redirects the URL to the backend port, bypassing Varnish.
E.g. clicking on link from the front page to sends the browser to
If I manually enter the URL in the browser without the port number then the page loads through Varnish just fine, but clicking any link automatically appends the port number.

I assume this is a configuration error, any ideas what's going on and how I can fix it?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the varnish-misc mailing list