Re: Frontend ACL rewrites URL incorrectly to backend

2015-10-05 Thread Daren Sefcik
Hey Joris, I appreciate the help...I am not sure I quite understand though,
is there something I can configure in haproxy to resolve this? It is not
just a Wordpress problem, I have other sites also that do not behave
correctly when I put haproxy in front of them.

On Mon, Oct 5, 2015 at 8:22 AM, joris dedieu  wrote:

> Hi,
>
> 2015-10-04 23:33 GMT+02:00 Daren Sefcik :
> > I am trying to make some requests go to specific backends but am finding
> > that in certain backends that the url gets doubled up or otherwise
> mangled,
> > ie:
> >
> > request to frontend = http://my.company.com
> > what the backend server ends up with =
> > http://my.company.comhttp://my.company.com
> >
> > This does not happen in all of the backends, only a few...a wordpress
> site
>
> This is typically what append when wordpress is invoked with a wrong
> Host header.
> It must match WP_SITEURL and WP_HOME
>
> Regards
> Joris
>
> > comes to mind as a specific example. Since this does not happen on every
> > single backend server I suspect it is instead something happening on the
> > receiving server but since it only happens when I put haproxy in front
> of it
> > there is some connection between them.
> >
> > Can someone help me understand what haproxy is doing or how to fix this
> from
> > happening?
> > Before anyone says it is varnish doing it I should say several of the
> other
> > backends using varnish work fine, it is only a few that get the url
> messed
> > up.
> >
> > TIA
> >
> > example ACL:
> >
> > acl   acl_my.company.com hdr(host) -i my.company.com
> > use_backend  VARNISH_BKEND if acl_my.company.com
>


Re: Frontend ACL rewrites URL incorrectly to backend

2015-10-05 Thread Igor Cicimov
Sorry don't know why the previous message was sent only to you and not to
the forum as well. Maybe because I sent it from my phone. Anyway,
rectifying that now.

>From what you posted about haproxy config, I can't see how can that acl
cause any problems and why would haproxy rewrite the url in the first
place. If that is happening then we all would be seeing the same problem
not just you. I'm also running WP on apache behind haproxy and definitely
don't see this issue. So it has to be something specific to your setup.
Maybe the combination of haproxy and varnish maybe htaccess file.

You can post the full setup of haproxy obfuscating any sensitive details.
Someone might notice something suspicious. Also taking tcpdump for the
traffic entering varnish should confirm that haproxy is mangling the url or
not. If it doens't then you move further down and take a tcp dump of the
traffic entering apache. In that way you will find the culprit for sure.

Cheers,
Igor



On Tue, Oct 6, 2015 at 9:22 AM, Daren Sefcik 
wrote:

> As I wrote in my previous emails it is not just a WP problem but several
> other sites also that behave weird but some others are just fine. They all
> work just fine with varnish and have been for several years, it is only a
> problem when I put haproxy in the front of all of it.
>
> wp-config is just the config file, if anything it may be an issue with
> whats in the .htaccess file but again, it is not just WP. I am happy to
> send you relevant parts of those files if you think you understand the
> problem and want to look at them.
>
> thanks,
> Daren
>
>
> On Mon, Oct 5, 2015 at 2:58 PM, Igor Cicimov <
> ig...@encompasscorporation.com> wrote:
>
>>
>> On 06/10/2015 5:48 AM, "Daren Sefcik"  wrote:
>> >
>> > Hey Joris, I appreciate the help...I am not sure I quite understand
>> though, is there something I can configure in haproxy to resolve this? It
>> is not just a Wordpress problem, I have other sites also that do not behave
>> correctly when I put haproxy in front of them.
>> >
>> > On Mon, Oct 5, 2015 at 8:22 AM, joris dedieu 
>> wrote:
>> >>
>> >> Hi,
>> >>
>> >> 2015-10-04 23:33 GMT+02:00 Daren Sefcik :
>> >> > I am trying to make some requests go to specific backends but am
>> finding
>> >> > that in certain backends that the url gets doubled up or otherwise
>> mangled,
>> >> > ie:
>> >> >
>> >> > request to frontend = http://my.company.com
>> >> > what the backend server ends up with =
>> >> > http://my.company.comhttp://my.company.com
>> >> >
>> >> > This does not happen in all of the backends, only a few...a
>> wordpress site
>> >>
>> >> This is typically what append when wordpress is invoked with a wrong
>> >> Host header.
>> >> It must match WP_SITEURL and WP_HOME
>> >>
>> >> Regards
>> >> Joris
>> >>
>> >> > comes to mind as a specific example. Since this does not happen on
>> every
>> >> > single backend server I suspect it is instead something happening on
>> the
>> >> > receiving server but since it only happens when I put haproxy in
>> front of it
>> >> > there is some connection between them.
>> >> >
>> >> > Can someone help me understand what haproxy is doing or how to fix
>> this from
>> >> > happening?
>> >> > Before anyone says it is varnish doing it I should say several of
>> the other
>> >> > backends using varnish work fine, it is only a few that get the url
>> messed
>> >> > up.
>> >> >
>> >> > TIA
>> >> >
>> >> > example ACL:
>> >> >
>> >> > acl   acl_my.company.com hdr(host) -i
>> my.company.com
>> >> > use_backend  VARNISH_BKEND if acl_my.company.com
>> >
>> >
>> Whats in your wp-config.php file? Also seams you have varnish in the mix
>> too you sure it is not varnish doing something weird?
>>
>>
>


-- 
Igor Cicimov | DevOps


p. +61 (0) 433 078 728
e. ig...@encompasscorporation.com 
w*.* encompasscorporation.com
a. Level 4, 65 York Street, Sydney 2000


Re: Frontend ACL rewrites URL incorrectly to backend

2015-10-05 Thread joris dedieu
Hi,

2015-10-04 23:33 GMT+02:00 Daren Sefcik :
> I am trying to make some requests go to specific backends but am finding
> that in certain backends that the url gets doubled up or otherwise mangled,
> ie:
>
> request to frontend = http://my.company.com
> what the backend server ends up with =
> http://my.company.comhttp://my.company.com
>
> This does not happen in all of the backends, only a few...a wordpress site

This is typically what append when wordpress is invoked with a wrong
Host header.
It must match WP_SITEURL and WP_HOME

Regards
Joris

> comes to mind as a specific example. Since this does not happen on every
> single backend server I suspect it is instead something happening on the
> receiving server but since it only happens when I put haproxy in front of it
> there is some connection between them.
>
> Can someone help me understand what haproxy is doing or how to fix this from
> happening?
> Before anyone says it is varnish doing it I should say several of the other
> backends using varnish work fine, it is only a few that get the url messed
> up.
>
> TIA
>
> example ACL:
>
> acl   acl_my.company.com hdr(host) -i my.company.com
> use_backend  VARNISH_BKEND if acl_my.company.com



Frontend ACL rewrites URL incorrectly to backend

2015-10-04 Thread Daren Sefcik
I am trying to make some requests go to specific backends but am finding
that in certain backends that the url gets doubled up or otherwise mangled,
ie:

request to frontend = http://my.company.com
what the backend server ends up with = http://my.company.comhttp://
my.company.com

This does not happen in all of the backends, only a few...a wordpress site
comes to mind as a specific example. Since this does not happen on every
single backend server I suspect it is instead something happening on the
receiving server but since it only happens when I put haproxy in front of
it there is some connection between them.

Can someone help me understand what haproxy is doing or how to fix this
from happening?
Before anyone says it is varnish doing it I should say several of the other
backends using varnish work fine, it is only a few that get the url messed
up.

TIA

example ACL:

acl   acl_my.company.com hdr(host) -i my.company.com
use_backend  VARNISH_BKEND if acl_my.company.com