All calls redirecting to backend port

Stephen Gazard StephenG at glam.com
Mon Mar 25 19:00:05 CET 2013


Hello,

From: varnish-misc-bounces at varnish-cache.org<mailto:varnish-misc-bounces at varnish-cache.org> [mailto:varnish-misc-bounces at varnish-cache.org] On Behalf Of Mike Noren
Sent: Monday, March 25, 2013 11:07 AM
To: varnish-misc at varnish-cache.org<mailto:varnish-misc at varnish-cache.org>
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 http://www.mysite.com/mypage.php?item=1234 sends the browser to http://www.mysite.com:8008/mypage.php?item=1234.
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?
It’s a server configuration error.  Assuming varnish & apache are on the same server

-          varnish listening on the public IP address port 80

-          apache listening on 127.0.0.1 on port 80.  If it’s on a separate server, modify Apache to listen on port 80 on the secondary server’s IP
Otherwise you get apache serving links via Varnish and it will put the non-standard port it thinks it sits on.

See http://ocaoimh.ie/2011/08/09/speed-up-wordpress-with-apache-and-varnish/

Regards,
Stephen

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20130325/60353360/attachment-0001.html>


More information about the varnish-misc mailing list