|
|
|
@ -1,6 +1,9 @@ |
|
|
|
#HA Proxy Config |
|
|
|
global |
|
|
|
maxconn 4096 |
|
|
|
ulimit-n 500000 |
|
|
|
maxconn 99999 |
|
|
|
maxpipes 99999 |
|
|
|
tune.maxaccept 500 |
|
|
|
|
|
|
|
log 127.0.0.1 local0 |
|
|
|
log 127.0.0.1 local1 notice |
|
|
|
@ -13,8 +16,6 @@ global |
|
|
|
|
|
|
|
defaults |
|
|
|
|
|
|
|
option forwardfor |
|
|
|
|
|
|
|
log global |
|
|
|
|
|
|
|
mode http |
|
|
|
@ -30,9 +31,22 @@ listen stats |
|
|
|
stats uri /stats |
|
|
|
stats auth admin:admin@123 |
|
|
|
|
|
|
|
listen mqtt-in |
|
|
|
bind *:${MQTT_PORT} |
|
|
|
mode tcp |
|
|
|
option clitcpka # For TCP keep-alive |
|
|
|
timeout client 3h |
|
|
|
timeout server 3h |
|
|
|
option tcplog |
|
|
|
balance leastconn |
|
|
|
server tbMqtt1 tb-mqtt-transport1:1883 check |
|
|
|
server tbMqtt2 tb-mqtt-transport2:1883 check |
|
|
|
|
|
|
|
frontend http-in |
|
|
|
bind *:${HTTP_PORT} |
|
|
|
|
|
|
|
option forwardfor |
|
|
|
|
|
|
|
reqadd X-Forwarded-Proto:\ http |
|
|
|
|
|
|
|
acl transport_http_acl path_beg /api/v1/ |
|
|
|
@ -46,15 +60,14 @@ frontend http-in |
|
|
|
frontend https_in |
|
|
|
bind *:${HTTPS_PORT} ssl crt /usr/local/etc/haproxy/default.pem crt /usr/local/etc/haproxy/certs.d ciphers ECDHE-RSA-AES256-SHA:RC4-SHA:RC4:HIGH:!MD5:!aNULL:!EDH:!AESGCM |
|
|
|
|
|
|
|
reqadd X-Forwarded-Proto:\ https |
|
|
|
option forwardfor |
|
|
|
|
|
|
|
default_backend tb-web-backend |
|
|
|
reqadd X-Forwarded-Proto:\ https |
|
|
|
|
|
|
|
frontend mqtt-in |
|
|
|
mode tcp |
|
|
|
bind *:${MQTT_PORT} |
|
|
|
acl transport_http_acl path_beg /api/v1/ |
|
|
|
use_backend tb-http-backend if transport_http_acl |
|
|
|
|
|
|
|
default_backend tb-mqtt-backend |
|
|
|
default_backend tb-web-backend |
|
|
|
|
|
|
|
backend letsencrypt_http |
|
|
|
server letsencrypt_http_srv 127.0.0.1:8080 |
|
|
|
@ -67,13 +80,6 @@ backend tb-web-backend |
|
|
|
server tbWeb2 tb-web-ui2:8080 check |
|
|
|
http-request set-header X-Forwarded-Port %[dst_port] |
|
|
|
|
|
|
|
backend tb-mqtt-backend |
|
|
|
balance leastconn |
|
|
|
option tcp-check |
|
|
|
option log-health-checks |
|
|
|
server tbMqtt1 tb-mqtt-transport1:1883 check |
|
|
|
server tbMqtt2 tb-mqtt-transport2:1883 check |
|
|
|
|
|
|
|
backend tb-http-backend |
|
|
|
balance leastconn |
|
|
|
option tcp-check |
|
|
|
|