Quantcast
Channel: HAProxy community - Latest topics
Viewing all articles
Browse latest Browse all 4849

HAProxy v2.2 change with %[url] variable including protocol

$
0
0

Since the commit here: http://git.haproxy.org/?p=haproxy.git;a=commit;h=30ee1efe676e8264af16bab833c621d60a72a4d7

…which added the protocol to the %[url] variable, the previous haproxy 1.8 configs I had working no longer function on v2.2(.2).

I’m looking for a suggestion of how best to complete both a redirect from http to https and a naked domain to www in a single line.

Previously this was accomplished as follows under v1.8 and worked well:
http-request set-var(req.scheme) str(https)
http-request redirect code 301 location %[var(req.scheme)]://www.domainname.com%[url] if { hdr(host) -i domainname.com }

For v1.8, a user browsing to https://domainname.com/path/or?query=whatever is successfully redirected to https://www.domainname.com/path/or?query=whatever

However on v2.2 the same implementation of %[url] results in the user getting: https://www.domainname.comhttps//domainname.com/path/or?query=whatever

What variables should be referenced to accomplish this?

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 4849

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>