Hi all,

I am trying to achieve the following in haproxy 1.6.6

We have a URL

www.old.com/audi/page/whatever<http://www.old.com/audi/page/whatever>

I'd like to redirect, maintaining everything after the first / ie 
/audi/page/whatever

For example

www.old.com/audi/page/whatever<http://www.old.com/audi/page/whatever>

redirects to

www.new.com/audi/page/whatever<http://www.newurl.com/audi/page/whatever>

Note that /audi/page/whatever will change all the time - essentially, I want to 
preserve whatever comes after the first /, just rewriting the domain part

I've tried a few things, the below seems to work if I hit the URL using HTTP 
but not if I use HTTPS (I need HTTPS)


frontend www.new.com
mode http
bind 145.90.33.11:80
bind 145.90.33.11:443 ssl crt /etc/haproxy/keys/www.new.com.pem no-sslv3 
ciphers 
ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-G$



#acl h_static hdr(Host) -m beg www.new.com

#reqirep ^Host:\ www.new.com      Host:\ www.old.com if h_static


redirect scheme https if !{ ssl_fc }
option forwardfor


default_backend www.old.com

backend www.old.com
mode http
balance roundrobin
cookie SERVERID insert indirect nocache secure

server Node1 pp-websv08:1061 check cookie Node1
server Node2 pp-websv09:1061 check cookie Node2
server Sorry_Server 192.168.33.200:80 check backup



Grateful for any suggestions and thanks for reading!


Mark


This e-mail message is being sent solely for use by the intended recipient(s) 
and may contain confidential information.  Any unauthorized review, use, 
disclosure or distribution is prohibited.  If you are not the intended 
recipient, please contact the sender by phone or reply by e-mail, delete the 
original message and destroy all copies. Thank you.

Reply via email to