diff options
author | Jenkins <jenkins@review.openstack.org> | 2016-03-28 21:16:05 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2016-03-28 21:16:05 +0000 |
commit | d876a555e25bb3f33a1b4121ba23d0ee400dabea (patch) | |
tree | f3430c5b0c7206586e9c3c7b1560b8031be9ed1c | |
parent | 8d5230ba11a176e17643f9ae498b90eebb1a5ec4 (diff) | |
parent | f8de51a85da685f92900ea17aef8b16a32661843 (diff) |
Merge "Redirect to https for horizon"
-rw-r--r-- | manifests/loadbalancer.pp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/manifests/loadbalancer.pp b/manifests/loadbalancer.pp index d61eea6..4264c22 100644 --- a/manifests/loadbalancer.pp +++ b/manifests/loadbalancer.pp @@ -861,13 +861,25 @@ class tripleo::loadbalancer ( $horizon_vip = hiera('horizon_vip', $controller_virtual_ip) if $horizon_bind_certificate { + # NOTE(jaosorior): If the horizon_vip and the public_virtual_ip are the + # same, the first option takes precedence. Which is the case when network + # isolation is not enabled. This is not a problem as both options are + # identical. If network isolation is enabled, this works correctly and + # will add a TLS binding to both the horizon_vip and the + # public_virtual_ip. + # Even though for the public_virtual_ip the port 80 is listening, we + # redirect to https in the horizon_options below. $horizon_bind_opts = { - "${horizon_vip}:80" => $haproxy_listen_bind_param, + "${horizon_vip}:80" => $haproxy_listen_bind_param, + "${horizon_vip}:443" => union($haproxy_listen_bind_param, ['ssl', 'crt', $horizon_bind_certificate]), + "${public_virtual_ip}:80" => $haproxy_listen_bind_param, "${public_virtual_ip}:443" => union($haproxy_listen_bind_param, ['ssl', 'crt', $horizon_bind_certificate]), } $horizon_options = { - 'cookie' => 'SERVERID insert indirect nocache', - 'rsprep' => '^Location:\ http://(.*) Location:\ https://\1', + 'cookie' => 'SERVERID insert indirect nocache', + 'rsprep' => '^Location:\ http://(.*) Location:\ https://\1', + # NOTE(jaosorior): We always redirect to https for the public_virtual_ip. + 'redirect' => "scheme https code 301 if { hdr(host) -i ${public_virtual_ip} } !{ ssl_fc }", } } else { $horizon_bind_opts = { |