Connecting through load-balancer (HAProxy) gives 404 errors.

1,961 views
Skip to first unread message

LGC

unread,
Feb 24, 2011, 5:35:04 AM2/24/11
to google-a...@googlegroups.com
I have a setup using HAProxy as a load balancer to redirect requests to different servers for static content, php, ...  and now wanted to add GAE into the mix to host a few webservices.

The webservices are up and running and connecting to them directly with SoapUI for testing, works like a charm.
Connecting through the load-balancer gives 404 not found !!!

Any ideas why ???

Regards,
Peter

Barry Hunter

unread,
Feb 24, 2011, 7:11:59 AM2/24/11
to google-a...@googlegroups.com
One thing to watch, appengine is a "cloud" service, and could well
move IP address from time to time.

This is normally transparently handled by DNS.

but early versions of HAproxy only accept a IP address for a server,
later versions accept a hostname, but will only resolve it once at
startup.

If this is your problem you might need to make sure a hostname is
specified in the config file. But also might need to be reloading
haproxy from time to time.

---

The next issue is the "Host" HTTP header. haproxy will just forward
the hostname provided by the client to the backend.

If this is not the hostname appengine is expecting then it wont work.
(either x.appspot.com or your custom domain)

... to resolve this, will probably need to use Google Apps to register
your actual domain, and setup Appengine to be accessible by that
domain name.
Alternativly might be able to get haproxy to rewrite the Host header
to one that AppEngine is expecting. I havent explored how feasible
this is in haproxy.

> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To post to this group, send email to google-a...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengi...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-appengine?hl=en.
>

LGC

unread,
Feb 24, 2011, 7:52:13 AM2/24/11
to google-a...@googlegroups.com
Thx for your input Barry,

I'm using version HAProxy 1.4.8 on Ubuntu specifying the hostname for my google app,
 so the 2nd point you make looks more like the culprit.

I'll have to dive into HAProxy manual to see if it's possible to rewrite the header part.

Thx for pointing me in that direction & I'll post back when I've done some research.


Regards,
Peter

LGC

unread,
Feb 24, 2011, 8:37:08 AM2/24/11
to google-a...@googlegroups.com
You saved the day Barry !!!

I've configured HAProxy to rewrite the 'Host' in the header and it's working like a charm !!


Thx again !!



P.



Barry Hunter

unread,
Feb 24, 2011, 10:19:51 AM2/24/11
to google-a...@googlegroups.com
> I've configured HAProxy to rewrite the 'Host' in the header and it's working
> like a charm !!

Excellent! Thanks for the update.

Reply all
Reply to author
Forward
0 new messages