基本框架
This commit is contained in:
37
ansible/files/01-08-haproxy/haproxy-proxy.cfg
Normal file
37
ansible/files/01-08-haproxy/haproxy-proxy.cfg
Normal file
@@ -0,0 +1,37 @@
|
||||
# 01-08 HAProxy - 启用 PROXY Protocol(send-proxy-v2)
|
||||
# 用于 Traefik 获取真实客户端 IP,需配合 Traefik trustedIPs
|
||||
# 文档:docs/01-08-openwrt-haproxy.md 第 5 节
|
||||
global
|
||||
log /dev/log local0
|
||||
maxconn 4096
|
||||
|
||||
defaults
|
||||
mode http
|
||||
option httplog
|
||||
timeout connect 5s
|
||||
timeout client 30s
|
||||
timeout server 30s
|
||||
|
||||
frontend http_in
|
||||
bind *:80
|
||||
default_backend k3s_http
|
||||
|
||||
frontend https_in
|
||||
bind *:443
|
||||
mode tcp
|
||||
default_backend k3s_https
|
||||
|
||||
backend k3s_http
|
||||
balance roundrobin
|
||||
server ylc61 192.168.2.61:80 check send-proxy-v2
|
||||
server ylc62 192.168.2.62:80 check send-proxy-v2
|
||||
server ylc63 192.168.2.63:80 check send-proxy-v2
|
||||
server ylc64 192.168.2.64:80 check send-proxy-v2
|
||||
|
||||
backend k3s_https
|
||||
mode tcp
|
||||
balance roundrobin
|
||||
server ylc61 192.168.2.61:443 check send-proxy-v2
|
||||
server ylc62 192.168.2.62:443 check send-proxy-v2
|
||||
server ylc63 192.168.2.63:443 check send-proxy-v2
|
||||
server ylc64 192.168.2.64:443 check send-proxy-v2
|
||||
Reference in New Issue
Block a user