Skip to content
Snippets Groups Projects
Commit 13a28c66 authored by jurgenhaas's avatar jurgenhaas
Browse files

Make sure http-request always comes before the first redirect

parent 0c25142b
No related branches found
No related tags found
No related merge requests found
......@@ -68,7 +68,16 @@ frontend http_in
{% for path in redirect.paths|default([]) %}
{% if path.deny|default(false) %}
http-request deny if { hdr(host) -i -n {{from}}{% if path.from is defined %} } { path_beg /{{path.from}}{% endif %} }
{% else %}
{% endif %}
{% endfor %}
{% endfor %}
{% endfor %}
{% endfor %}
{% for host in groups['all'] %}
{% for redirect in hostvars[host].proxy_redirect|default([]) %}
{% for from in redirect.from %}
{% for path in redirect.paths|default([]) %}
{% if not path.deny|default(false) %}
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 %} }
{% endif %}
{% endfor %}
......@@ -135,7 +144,16 @@ frontend https_in_{{ cert.ip }}
{% for path in redirect.paths|default([]) %}
{% if path.deny|default(false) %}
http-request deny if { hdr(host) -i -n {{from}}{% if path.from is defined %} } { path_beg /{{path.from}}{% endif %} }
{% else %}
{% endif %}
{% endfor %}
{% endfor %}
{% endfor %}
{% endfor %}
{% for host in groups['all'] %}
{% for redirect in hostvars[host].proxy_redirect|default([]) %}
{% for from in redirect.from %}
{% for path in redirect.paths|default([]) %}
{% if not path.deny|default(false) %}
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 %} }
{% endif %}
{% endfor %}
......
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