Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
haproxy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ansible
Roles
haproxy
Commits
7017dc71
Commit
7017dc71
authored
6 years ago
by
jurgenhaas
Browse files
Options
Downloads
Patches
Plain Diff
Implement support for redirect maps with domain and path as the key
parent
86ad589b
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
defaults/main.yml
+1
-0
1 addition, 0 deletions
defaults/main.yml
tasks/configure.yml
+1
-0
1 addition, 0 deletions
tasks/configure.yml
templates/haproxy_cfg.jinja2
+2
-0
2 additions, 0 deletions
templates/haproxy_cfg.jinja2
with
4 additions
and
0 deletions
defaults/main.yml
+
1
−
0
View file @
7017dc71
...
...
@@ -10,6 +10,7 @@ proxy_maxconn: 100
proxy_varnish_maxconn
:
1000
proxy_redirect_maps
:
domain
:
{}
domain-and-path
:
{}
domain-append-path
:
{}
path
:
{}
proxy_blacklist
:
...
...
This diff is collapsed.
Click to expand it.
tasks/configure.yml
+
1
−
0
View file @
7017dc71
...
...
@@ -114,6 +114,7 @@
mode='644'
with_items
:
-
'
domain'
-
'
domain-and-path'
-
'
domain-append-path'
-
'
path'
notify
:
"
Check
HAProxy
Config"
...
...
This diff is collapsed.
Click to expand it.
templates/haproxy_cfg.jinja2
+
2
−
0
View file @
7017dc71
...
...
@@ -71,6 +71,7 @@ frontend http_in
{% endfor %}
http-request set-header x-routing-host undefined
acl letsencrypt_challenge path_beg /.well-known/acme-challenge/
http-request redirect code 301 location %[base,map(/etc/haproxy/redirect.domain-and-path.map)] if !letsencrypt_challenge { base,map(/etc/haproxy/redirect.domain-and-path.map) -m found }
http-request redirect code 301 location %[capture.req.uri,map(/etc/haproxy/redirect.path.map)] if !letsencrypt_challenge { capture.req.uri,map(/etc/haproxy/redirect.path.map) -m found }
http-request redirect code 301 location %[hdr(host),map(/etc/haproxy/redirect.domain.map)] if !letsencrypt_challenge { hdr(host),map(/etc/haproxy/redirect.domain.map) -m found }
http-request redirect code 301 location %[hdr(host),map(/etc/haproxy/redirect.domain-append-path.map)]%[capture.req.uri] if !letsencrypt_challenge { hdr(host),map(/etc/haproxy/redirect.domain-append-path.map) -m found }
...
...
@@ -191,6 +192,7 @@ frontend http_in
frontend https_in_{{ cert.ip }}
bind {{ cert.ip }}:443 ssl crt /etc/haproxy/certs/{{ cert.file }} no-sslv3
http-request del-header Proxy
http-request redirect code 301 location %[base,map(/etc/haproxy/redirect.domain-and-path.map)] if { base,map(/etc/haproxy/redirect.domain-and-path.map) -m found }
http-request redirect code 301 location %[capture.req.uri,map(/etc/haproxy/redirect.path.map)] if { capture.req.uri,map(/etc/haproxy/redirect.path.map) -m found }
http-request redirect code 301 location %[hdr(host),map(/etc/haproxy/redirect.domain.map)] if { hdr(host),map(/etc/haproxy/redirect.domain.map) -m found }
http-request redirect code 301 location %[hdr(host),map(/etc/haproxy/redirect.domain-append-path.map)]%[capture.req.uri] if { hdr(host),map(/etc/haproxy/redirect.domain-append-path.map) -m found }
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment