Hi All,

Having what I hope is a simple problem to resolve with HAProxy and reverse 
proxy'ing to an external server.

In a nutshell, our company (www.company.com) has a blog website hosted by a 3rd 
party (blog.3rdparty.com).  We want users to see the blog site by browsing to 
www.company.com/blog.

Using www.google.co.uk as an example, I'm hoping to browse to 
www.company.com/blog and see the google.co.uk homepage:

acl is_proxypass path_beg -i /blog  ###rule to match any uri beginning with 
/blog
use_backend proxypass if is_proxypass 

backend proxypass    
reqirep ^Host:\ www.company.com Host:\ www.google.co.uk ### rewrite host header 
before it is sent to external server
reqirep ^([^\ ]*)\ /blog(.*) \1\ /\2   ###remove /blog uri as google.co.uk/blog 
doesn't exist
server blogs www.google.co.uk   ###request sent to external server, 
www.google.co.uk in this example

The above config sort of works.  The google.co.uk homepage is shown, however 
there are lots of missing images and missing javascript due to 404 errors.  I 
believe this is because HAProxy is passing back google.co.uk/image.png as 
www.company.com/image.png.  This doesn't match the "path_beg -i /blog" rule and 
so it causes a 404 as google's image doesn't exist on www.company.com webserver.

Will greatly appreciate any feedback/solutions.  I'm certain this sort of thing 
should be possible to do with HAProxy.
.

---
posted at http://www.serverphorums.com
http://www.serverphorums.com/read.php?10,445085,445085#msg-445085

Reply via email to