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
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
Eric Zillmann
haproxy
Commits
ad0ebaf7
Commit
ad0ebaf7
authored
9 years ago
by
jurgenhaas
Browse files
Options
Downloads
Patches
Plain Diff
Get HaProxy and Varnish work together
parent
7fe1c295
No related branches found
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
+14
-2
14 additions, 2 deletions
templates/haproxy_cfg
with
14 additions
and
2 deletions
templates/haproxy_cfg
+
14
−
2
View file @
ad0ebaf7
...
...
@@ -46,6 +46,10 @@ frontend http-in
bind *:80
acl blockedip src -i -f /etc/haproxy/blacklist
http-request deny if blockedip
{% if varnish_host|default(false) %}
acl static_content path_end .jpg .jpeg .gif .png .ico .swf .css .js .htm .html
use_backend backend_varnish if static_content
{% endif %}
{% for host in groups['all'] %}
{% for redirect in hostvars[host].proxy_redirect|default([]) %}
redirect prefix http://{{redirect.to}} if { hdr_dom(host) -i {{redirect.from}} }
...
...
@@ -67,6 +71,10 @@ frontend https-in-{{ cert.ip }}
bind {{ cert.ip }}:443 ssl crt /etc/haproxy/certs/{{ cert.file }} no-sslv3
acl blockedip src -i -f /etc/haproxy/blacklist
http-request deny if blockedip
{% if varnish_host|default(false) %}
acl static_content path_end .jpg .jpeg .gif .png .ico .swf .css .js .htm .html
use_backend backend_varnish if static_content
{% endif %}
{% for host in groups['all'] %}
{% for redirect in hostvars[host].proxy_redirect|default([]) %}
redirect prefix https://{{redirect.to}} if { hdr_dom(host) -i {{redirect.from}} }
...
...
@@ -83,12 +91,16 @@ frontend https-in-{{ cert.ip }}
{% endif %}
{% endfor %}
{% endfor %}
{% for host in groups['all'] %}
backend backend_{{host}}
server server_{{host}} {{hostvars[host]['static_ipv4']|default(hostvars[host]['ansible_default_ipv4']['address'])}}:80 maxconn 32
{% endfor %}
{% if varnish_host|default(false) %}
backend backend_varnish
server varnish {{ varnish_host }}:6081 maxconn 32
{% endif %}
backend backend_redirect_ssl
redirect scheme https if TRUE
...
...
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