66 lines
1.9 KiB
INI
Executable File
66 lines
1.9 KiB
INI
Executable File
global
|
|
log stdout format raw local0 info
|
|
maxconn 8192
|
|
|
|
defaults
|
|
log global
|
|
mode http
|
|
option httplog
|
|
option dontlognull
|
|
option forwardfor
|
|
timeout connect 5000
|
|
timeout client 50000
|
|
timeout server 50000
|
|
|
|
userlist users
|
|
user alex password $6$kW4zFajpkGGupxHU$KgzNS59z9OvJwAMvFg.EtU/hlgXWbGANoazzedpYRExZE9tJzw8kQlivIDUtvLgcsHYrFTpldRzeTaekBFtIW0
|
|
user worker password $6$kW4zFajpkGGupxHU$KgzNS59z9OvJwAMvFg.EtU/hlgXWbGANoazzedpYRExZE9tJzw8kQlivIDUtvLgcsHYrFTpldRzeTaekBFtIW0
|
|
|
|
frontend https
|
|
bind *:80
|
|
bind *:443 ssl crt /usr/local/etc/haproxy/mrhossa.pem
|
|
http-request set-header X-Forwarded-Proto https if { ssl_fc }
|
|
|
|
# acl valid_method method PUT DELETE GET POST HEAD PATCH
|
|
# http-request deny if !valid_method
|
|
|
|
# acl is_trusted src 178.19.224.210
|
|
|
|
# stick-table type ip size 100k expire 30s store http_req_rate(60s)
|
|
|
|
# http-request track-sc0 src
|
|
# acl rate_too_high sc0_http_req_rate gt 240
|
|
# http-request deny status 429 if rate_too_high !is_trusted
|
|
|
|
acl is_public hdr(host) -i mrhossa.de
|
|
acl is_backend hdr(host) -i backend.mrhossa.de
|
|
acl is_gitea hdr(host) -i gitea.mrhossa.de
|
|
acl is_stats hdr(host) -i stats.mrhossa.de
|
|
|
|
use_backend web_public if is_public
|
|
use_backend web_backend if is_backend
|
|
use_backend web_gitea if is_gitea
|
|
use_backend stats if is_stats
|
|
|
|
default_backend web_public
|
|
|
|
backend web_public
|
|
cookie SESSSRV insert preserve nocache httponly secure
|
|
server node1 152.53.159.169:8001 cookie node1 check
|
|
|
|
backend web_backend
|
|
cookie SESSSRV insert preserve nocache httponly secure
|
|
server node1 152.53.159.169:8002 cookie node1 check
|
|
|
|
backend web_gitea
|
|
server Gitea 152.53.159.169:3000 check
|
|
|
|
backend stats
|
|
mode http
|
|
stats enable
|
|
stats uri /
|
|
stats realm Haproxy\ Statistics
|
|
stats auth worker:souIfurULCSDnoKuPNxrLCTi
|
|
stats admin if TRUE
|
|
|