UPD: Updated haproxy config, added stats access

This commit is contained in:
KF 2024-10-02 10:26:33 +08:00
parent 6508f8111d
commit 264867345b
Signed by: xpk
GPG Key ID: CD4FF6793F09AB86
3 changed files with 23 additions and 10 deletions

View File

@ -1,6 +1,7 @@
FROM alpine:latest
ENV container docker
RUN apk update; apk upgrade; apk add haproxy
RUN apk update; apk upgrade; apk add haproxy tzdata
COPY haproxy.cfg /etc/haproxy/haproxy.cfg
RUN ln -s /usr/share/zoneinfo/Asia/Hong_Kong /etc/localtime
EXPOSE 41080
CMD [ "/usr/sbin/haproxy", "-f", "/etc/haproxy/haproxy.cfg", "-db" ]

3
alpine/haproxy/README.md Normal file
View File

@ -0,0 +1,3 @@
Access stats:
http://192.168.86.208:44644/stats

View File

@ -1,22 +1,31 @@
global
log 127.0.0.1 local2
chroot /var/lib/haproxy
pidfile /var/run/haproxy.pid
maxconn 4000
user haproxy
group haproxy
daemon
log 192.168.86.10 local0 notice
chroot /var/lib/haproxy
pidfile /var/run/haproxy.pid
maxconn 600
user haproxy
group haproxy
daemon
defaults
log global
mode tcp
timeout client 10s
timeout connect 5s
timeout server 10s
frontend stats
mode http
bind *:44644
stats enable
stats uri /stats
stats refresh 10s
stats auth admin:qwerty-asdf-1234
frontend socks-front
bind *:41080
default_backend socks-back
backend socks-back
server appgate 192.168.86.22:9080 check
server gw2 192.168.86.2:11080 check backup
server ism 192.168.86.18:11080 check backup