Hi,
There is small discrepancy in the documentation for version 1..5.x.
req.uri is used where it should be capture.req.uri.
Also no scheme is used resulting in a redirect loop.
Patch as follows:
# diff -u /usr/share/doc/haproxy-1.5.15/configuration.txt
/usr/share/doc/haproxy-1.5.15/configuration.txt.new
--- /usr/share/doc/haproxy-1.5.15/configuration.txt 2015-11-05
14:55:32.000000000 +0100
+++ /usr/share/doc/haproxy-1.5.15/configuration.txt.new 2016-04-11
11:28:42.376609464 +0200
@@ -5509,7 +5509,7 @@
redirect scheme https if !{ ssl_fc }
Example: append 'www.' prefix in front of all hosts not having it
- http-request redirect code 301 location www.%[hdr(host)]%[req.uri]
\
+ http-request redirect code 301 location
http://www.%[hdr(host)]%[capture.req.uri]
\
unless { hdr_beg(host) -i www }
See section 7 about ACL usage.
Kind regards,
Coen
There is small discrepancy in the documentation for version 1..5.x.
req.uri is used where it should be capture.req.uri.
Also no scheme is used resulting in a redirect loop.
Patch as follows:
# diff -u /usr/share/doc/haproxy-1.5.15/configuration.txt
/usr/share/doc/haproxy-1.5.15/configuration.txt.new
--- /usr/share/doc/haproxy-1.5.15/configuration.txt 2015-11-05
14:55:32.000000000 +0100
+++ /usr/share/doc/haproxy-1.5.15/configuration.txt.new 2016-04-11
11:28:42.376609464 +0200
@@ -5509,7 +5509,7 @@
redirect scheme https if !{ ssl_fc }
Example: append 'www.' prefix in front of all hosts not having it
- http-request redirect code 301 location www.%[hdr(host)]%[req.uri]
\
+ http-request redirect code 301 location
http://www.%[hdr(host)]%[capture.req.uri]
\
unless { hdr_beg(host) -i www }
See section 7 about ACL usage.
Kind regards,
Coen