Skip to content
Snippets Groups Projects
Commit 68f1746d authored by jurgenhaas's avatar jurgenhaas
Browse files

Support more sophisticated redirects

parent f7824318
No related branches found
No related tags found
No related merge requests found
......@@ -60,7 +60,12 @@ frontend http_in
http-request deny if blockedagent
{% for host in groups['all'] %}
{% for redirect in hostvars[host].proxy_redirect|default([]) %}
redirect prefix {{ redirect.protocol|default('https') }}://{{redirect.to}} code 301 if { hdr(host) -i -n {{redirect.from}} }
{% for from in redirect.from %}
{% for path in redirect.paths|default([]) %}
redirect location {{ redirect.protocol|default('https') }}://{{redirect.to}}/{{path.to|default('')}} code 301 if { hdr(host) -i -n {{from}}{% if path.from is defined %} } { path_beg /{{path.from}}{% endif %} }
{% endfor %}
redirect prefix {{ redirect.protocol|default('https') }}://{{redirect.to}} code 301 if { hdr(host) -i -n {{from}} }
{% endfor %}
{% endfor %}
{% if proxy_redirect_aliase %}
{% for drupal in hostvars[host].drupal_settings|default([]) %}
......@@ -104,7 +109,12 @@ frontend https_in_{{ cert.ip }}
http-request deny if blockedagent
{% for host in groups['all'] %}
{% for redirect in hostvars[host].proxy_redirect|default([]) %}
redirect prefix {{ redirect.protocol|default('https') }}://{{redirect.to}} code 301 if { hdr(host) -i -n {{redirect.from}} }
{% for from in redirect.from %}
{% for path in redirect.paths|default([]) %}
redirect location {{ redirect.protocol|default('https') }}://{{redirect.to}}/{{path.to|default('')}} code 301 if { hdr(host) -i -n {{from}}{% if path.from is defined %} } { path_beg /{{path.from}}{% endif %} }
{% endfor %}
redirect prefix {{ redirect.protocol|default('https') }}://{{redirect.to}} code 301 if { hdr(host) -i -n {{from}} }
{% endfor %}
{% endfor %}
{% if proxy_redirect_aliase %}
{% for drupal in hostvars[host].drupal_settings|default([]) %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment