All calls redirecting to backend port (Stephen Gazard)

Mike Noren mike_noren2002 at yahoo.co.uk
Tue Mar 26 09:38:35 CET 2013


Thank you to everyone, and especially Stephen Gazard - you were right, the problem was that Apache was set to use *:8080, and was solved when I specified that Apache should use 127.0.0.1:80.

A final quick note for future users who might read this: remember to also clear your _browser_ cache when testing any changes you've made. Had me puzzled for a bit.

And again, thanks!

--- On Mon, 25/3/13, varnish-misc-request at varnish-cache.org <varnish-misc-request at varnish-cache.org> wrote:

From: varnish-misc-request at varnish-cache.org <varnish-misc-request at varnish-cache.org>
Subject: varnish-misc Digest, Vol 84, Issue 26
To: varnish-misc at varnish-cache.org
Date: Monday, 25 March, 2013, 19:00

Send varnish-misc mailing list submissions to
    varnish-misc at varnish-cache.org

To subscribe or unsubscribe via the World Wide Web, visit
    https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
or, via email, send a message with subject or body 'help' to
    varnish-misc-request at varnish-cache.org

You can reach the person managing the list at
    varnish-misc-owner at varnish-cache.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of varnish-misc digest..."


Today's Topics:

   1. Re: Varnish 3.0.3 - segfault in libvarnish.so. (Rafa? Radecki)
   2. All calls redirecting to backend port (Mike Noren)
   3. RE: All calls redirecting to backend port (Rangel, Raul)
   4. RE: All calls redirecting to backend port (Stephen Gazard)


----------------------------------------------------------------------

Message: 1
Date: Mon, 25 Mar 2013 12:00:15 +0100
From: Rafa? Radecki <radecki.rafal at gmail.com>
To: Lasse Karstensen <lkarsten at varnish-software.com>
Cc: varnish-misc at varnish-cache.org
Subject: Re: Varnish 3.0.3 - segfault in libvarnish.so.
Message-ID:
    <CAHd9_iTZ_p2k8ZQN6sf=sV5C4tKfSg0bNn64OsNw986q=kXgfA at mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-2

Hi.

I've added a ticket: https://www.varnish-cache.org/trac/ticket/1287 .

Best regards,
Rafal.

2013/3/23 Lasse Karstensen <lkarsten at varnish-software.com>:
> On Fri, Mar 22, 2013 at 11:56:48AM +0100, Rafa? Radecki wrote:
>> I use varnish 3.0.3 on my production server:
> [..]
>> Mar 22 09:00:07 server.local kernel: : varnishd[2085]: segfault at 0
>> ip 0000003f60c0c234 sp 00007fa9217cc2e0 error 4 in
>> libvarnish.so[3f60c00000+13000]
>
> This should never happen and may require a bit of effort to figure out.
>
> Please file a bug report on this in the main bugtracker:
>
>         https://www.varnish-cache.org/trac/
>
> --
> With regards,
> Lasse Karstensen
> Varnish Software AS



------------------------------

Message: 2
Date: Mon, 25 Mar 2013 17:07:04 +0000 (GMT)
From: Mike Noren <mike_noren2002 at yahoo.co.uk>
To: varnish-misc at varnish-cache.org
Subject: All calls redirecting to backend port
Message-ID:
    <1364231224.48157.YahooMailClassic at web172306.mail.ir2.yahoo.com>
Content-Type: text/plain; charset="utf-8"

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?

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

------------------------------

Message: 3
Date: Mon, 25 Mar 2013 10:41:43 -0700
From: "Rangel, Raul" <Raul.Rangel at disney.com>
To: "'Mike Noren'" <mike_noren2002 at yahoo.co.uk>,
    "'varnish-misc at varnish-cache.org'" <varnish-misc at varnish-cache.org>
Subject: RE: All calls redirecting to backend port
Message-ID:
    <2465AAEEC8B8A242B26ED5F44BCA805F2610319D55 at SM-CALA-VXMB04A.swna.wdpr.disney.com>
    
Content-Type: text/plain; charset="utf-8"

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.

Raul

From: 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
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?


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

------------------------------

Message: 4
Date: Mon, 25 Mar 2013 18:00:05 +0000
From: Stephen Gazard <StephenG at glam.com>
To: "'varnish-misc at varnish-cache.org'"
    <varnish-misc at varnish-cache.org>
Subject: RE: All calls redirecting to backend port
Message-ID:
    <D19C0500E58C3F42B2C121A7BDABB730521AA3CD at gmmxmb03z03.projecty.com>
Content-Type: text/plain; charset="utf-8"

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.html>

------------------------------

_______________________________________________
varnish-misc mailing list
varnish-misc at varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc

End of varnish-misc Digest, Vol 84, Issue 26
********************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20130326/151b7b9f/attachment-0001.html>


More information about the varnish-misc mailing list