Created
July 8, 2014 20:32
-
-
Save cap10morgan/4f04a21680f0f8eefd49 to your computer and use it in GitHub Desktop.
confd config and template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# template resource - /confd/conf.d/haproxy.toml | |
[template] | |
src = "haproxy.cfg.tmpl" | |
dest = "/etc/haproxy/haproxy.cfg" | |
owner = "root" | |
group = "root" | |
mode = "0644" | |
keys = [ "/ftp-reverse-proxy" ] | |
check_cmd = "/usr/sbin/haproxy -c -q -f {{ .src }}" | |
reload_cmd = "/usr/sbin/haproxy -f {{ .src }} -p /var/run/haproxy.pid -sf $(</var/run/haproxy.pid)" | |
# template - /confd/templates/haproxy.cfg.tmpl | |
global | |
maxconn 256 | |
defaults | |
timeout connect 10000ms | |
timeout client 2000ms | |
timeout server 2000ms | |
listen stats :80 | |
mode http | |
stats enable | |
stats hide-version | |
stats realm haproxy\ stats | |
stats uri / | |
listen ftp :21,:57649-57700 | |
mode tcp | |
option tcp-check | |
tcp-check expect string 220 | |
# for each remote s3-ftp server in cluster... | |
{{ range $i, $server := .ftp-reverse-proxy_host }} | |
{{ if $i }} # true when $i > 0; all but first are backups | |
server {{ $server.Value }} {{ $server.Value }} check port 21 inter 2s backup | |
{{ else }} # first server is the active backend | |
server {{ $server.Value }} {{ $server.Value }} check port 21 inter 2s | |
{{ end }} | |
{{ end }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment