2014-03-14 17:50:31 +08:00
|
|
|
#
|
|
|
|
# {{ ansible_managed }}
|
|
|
|
#
|
|
|
|
global
|
2014-03-17 18:27:49 +08:00
|
|
|
log /dev/log local0
|
|
|
|
log /dev/log local1 notice
|
|
|
|
chroot /var/lib/haproxy
|
|
|
|
user haproxy
|
|
|
|
group haproxy
|
|
|
|
daemon
|
|
|
|
stats socket /var/lib/haproxy/stats level admin
|
2014-03-14 17:50:31 +08:00
|
|
|
|
|
|
|
defaults
|
2014-03-17 18:27:49 +08:00
|
|
|
log global
|
|
|
|
mode http
|
|
|
|
option httplog
|
|
|
|
option dontlognull
|
|
|
|
contimeout 5000
|
|
|
|
clitimeout 50000
|
|
|
|
srvtimeout 50000
|
|
|
|
errorfile 400 /etc/haproxy/errors/400.http
|
|
|
|
errorfile 403 /etc/haproxy/errors/403.http
|
|
|
|
errorfile 408 /etc/haproxy/errors/408.http
|
|
|
|
errorfile 500 /etc/haproxy/errors/500.http
|
|
|
|
errorfile 502 /etc/haproxy/errors/502.http
|
|
|
|
errorfile 503 /etc/haproxy/errors/503.http
|
|
|
|
errorfile 504 /etc/haproxy/errors/504.http
|
2014-03-14 17:50:31 +08:00
|
|
|
|
|
|
|
frontend http_frontend
|
2014-03-17 18:27:49 +08:00
|
|
|
bind *:80
|
|
|
|
mode http
|
|
|
|
option httpclose
|
|
|
|
option forwardfor
|
|
|
|
default_backend rgw
|
2014-03-14 17:50:31 +08:00
|
|
|
|
|
|
|
frontend https_frontend
|
2014-03-17 18:27:49 +08:00
|
|
|
bind *:443 ssl crt /etc/ceph/radosgw-key-cert.pem
|
|
|
|
mode http
|
|
|
|
option httpclose
|
|
|
|
option forwardfor
|
|
|
|
reqadd X-Forwarded-Proto:\ https
|
|
|
|
default_backend rgw
|
2014-03-14 17:50:31 +08:00
|
|
|
|
2014-03-15 20:10:59 +08:00
|
|
|
backend rgw
|
2014-03-17 18:27:49 +08:00
|
|
|
mode http
|
|
|
|
balance roundrobin
|
|
|
|
cookie RADOSGWLB insert indirect nocache
|
2014-03-14 17:50:31 +08:00
|
|
|
{% for host in groups['rgws'] %}
|
2014-03-17 18:27:49 +08:00
|
|
|
server {{ hostvars[host].ansible_hostname }} {{ hostvars[host]['ansible_' + radosgw_interface ].ipv4.address }}:80 check cookie {{ hostvars[host].ansible_hostname }}
|
2014-03-14 17:50:31 +08:00
|
|
|
{% endfor %}
|
|
|
|
|
|
|
|
listen stats :8080
|
2014-03-17 18:27:49 +08:00
|
|
|
mode http
|
|
|
|
stats enable
|
|
|
|
stats hide-version
|
|
|
|
stats realm Haproxy\ Statistics
|
|
|
|
stats uri /
|
|
|
|
#stats auth Username:Password
|