Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
Haproxy
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Timothee Gosselin
Haproxy
Commits
8b6793ef
Commit
8b6793ef
authored
8 years ago
by
Pierre Ozoux
Browse files
Options
Downloads
Patches
Plain Diff
Use VIRTUAL_HOST
parent
97016154
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
templates/haproxy.cfg.tmpl
+6
-5
6 additions, 5 deletions
templates/haproxy.cfg.tmpl
with
6 additions
and
5 deletions
templates/haproxy.cfg.tmpl
+
6
−
5
View file @
8b6793ef
...
...
@@ -33,15 +33,16 @@ mode http
rspadd Strict-Transport-Security:\ max-age=15768000
use_backend letsencrypt if { path_beg /.well-known/acme }
{{ range $host, $container := groupBy $ "Env.
HOST
" }}
use_backend {{ $host}} if { hdr(host) -i {{ $host }}
www.{{ $host }}
}
{{ range $host, $container
s
:= groupBy
Multi
$ "Env.
VIRTUAL_HOST" ",
" }}
use_backend {{ $host}} if { hdr(host) -i {{ $host }} }
{{end}}
{{ $containers := whereExist $ "Env.HOST" }}
{{ range $container := $containers }}
backend {{ $container.Env.HOST }}
{{ range $host, $containers := groupByMulti $ "Env.VIRTUAL_HOST" "," }}
backend {{ $host }}
cookie SERVERID insert nocache indirect
{{ range $container := $containers }}
server Server {{ $container.IP }}:80 cookie Server
{{end}}
{{end}}
backend letsencrypt
...
...
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