Skip to content

Commit

Permalink
Haproxy: Redirect rule now uses base so you can redirect a URL +path
Browse files Browse the repository at this point in the history
  • Loading branch information
quartje committed May 28, 2024
1 parent 5d05e36 commit 091583c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion roles/haproxy/templates/haproxy_frontend.cfg.j2
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ frontend local_ip
acl securitytxt path /.well-known/security.txt
http-request redirect location {{ haproxy_securitytxt_target_url }} if securitytxt
{% endif %}
http-request redirect location %[req.hdr(host),lower,map(/etc/haproxy/maps/redirects.map)] if { req.hdr(host),lower,map_str(/etc/haproxy/maps/redirects.map) -m found }
http-request redirect location %[base,map_reg(/etc/haproxy/maps/redirects.map)] if { base,map_reg(/etc/haproxy/maps/redirects.map) -m found }

{% if haproxy_sni_ip_restricted is defined %}
#--------------------------------------------------------------------
Expand Down
3 changes: 3 additions & 0 deletions roles/haproxy/templates/validvhostsunrestricted.acl.j2
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
{% endfor %}
{%if haproxy_redirects is defined %}
{% for application in haproxy_redirects %}
{%if application.hostname is defined %}
{{ application.hostname }}
{% endif %}
{{ application.url }}
{% endfor %}
{% endif %}

0 comments on commit 091583c

Please sign in to comment.