-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 3de513a
Showing
2 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
FROM ubuntu:14.04 | ||
RUN apt-get update && apt-get -y install haproxy | ||
VOLUME /etc/haproxy | ||
EXPOSE 9000 | ||
EXPOSE 9001 | ||
ADD haproxy.cfg /etc/haproxy/ | ||
CMD haproxy -f /etc/haproxy/haproxy.cfg -db |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
global | ||
#log /dev/log local0 | ||
#log /dev/log local1 notice | ||
chroot /var/lib/haproxy | ||
user haproxy | ||
group haproxy | ||
daemon | ||
|
||
defaults | ||
#log global | ||
mode http | ||
#option httplog | ||
#option dontlognull | ||
contimeout 5000 | ||
clitimeout 50000 | ||
srvtimeout 50000 | ||
|
||
balance roundrobin | ||
option abortonclose | ||
option redispatch | ||
retries 3 | ||
|
||
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 | ||
|
||
listen stats 0.0.0.0:9001 # Listen on all IP's on port 9000 | ||
mode http | ||
balance | ||
timeout client 5000 | ||
timeout connect 4000 | ||
timeout server 30000 | ||
|
||
stats enable | ||
# This is the virtual URL to access the stats page | ||
stats uri /haproxy_stats | ||
|
||
# Authentication realm. This can be set to anything. Escape space characters with a backslash. | ||
stats realm HAProxy\ Statistics | ||
|
||
# The user/pass you want to use. Change this password! | ||
stats auth admin:passwordhere | ||
|
||
# This allows you to take down and bring up back end servers. | ||
# This will produce an error on older versions of HAProxy. | ||
stats admin if TRUE |