I am currently using apache and mod_proxy to map a local url to a remote url. I am doing this so that https requests will still work properly. In apache I have the following line in my VirtualHost
RewriteRule ^/autocomplete/cities/(.*)$ http://autocomplete.wunderground.com/aq$1 [P]
I am trying to move this to HAProxy now and I am having trouble figuring out how to do this same thing. Here is my current config.
defaults
mode http
timeout client 5s
timeout connect 5s
timeout server 5s
frontend http x.x.x.x:80
mode http
timeout client 120s
option forwardfor
default_backend application
reqadd X-Forwarded-Proto:\ http
frontend https x.x.x.x:81
mode http
timeout client 120s
option forwardfor
default_backend application
reqadd X-Forwarded-Proto:\ https
backend application
balance roundrobin
server app1 x.x.x.x:80 maxconn 1 check
server app2 x.x.x.x:80 maxconn 1 check