53 lines
1.4 KiB
INI
53 lines
1.4 KiB
INI
|
|
global
|
||
|
|
log stdout format raw local0
|
||
|
|
maxconn 2000
|
||
|
|
|
||
|
|
defaults
|
||
|
|
log global
|
||
|
|
mode http
|
||
|
|
option httplog
|
||
|
|
option dontlognull
|
||
|
|
timeout connect 5000
|
||
|
|
timeout client 50000
|
||
|
|
timeout server 50000
|
||
|
|
|
||
|
|
frontend http-in
|
||
|
|
bind *:80
|
||
|
|
# bind *:443 ssl crt /usr/local/etc/haproxy/certs/veza.pem
|
||
|
|
# SSL disabled for simple lab setup unless certs exist. Redirecting removed.
|
||
|
|
|
||
|
|
# ACLs for routing
|
||
|
|
acl path_api path_beg /api
|
||
|
|
acl path_ws path_beg /ws/chat
|
||
|
|
acl path_stream path_beg /hls /stream
|
||
|
|
|
||
|
|
# CORS
|
||
|
|
http-response set-header Access-Control-Allow-Origin "*"
|
||
|
|
http-response set-header Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept, Authorization"
|
||
|
|
http-response set-header Access-Control-Allow-Methods "GET, POST, PUT, DELETE, OPTIONS"
|
||
|
|
|
||
|
|
# Routing logic
|
||
|
|
use_backend backend_go if path_api
|
||
|
|
use_backend backend_chat if path_ws
|
||
|
|
use_backend backend_stream if path_stream
|
||
|
|
|
||
|
|
# Default to Frontend (React)
|
||
|
|
default_backend backend_web
|
||
|
|
|
||
|
|
backend backend_go
|
||
|
|
balance roundrobin
|
||
|
|
# Using host.docker.internal to reach host services
|
||
|
|
server api1 host.docker.internal:8080 check
|
||
|
|
|
||
|
|
backend backend_chat
|
||
|
|
balance roundrobin
|
||
|
|
server chat1 host.docker.internal:8081 check
|
||
|
|
|
||
|
|
backend backend_stream
|
||
|
|
balance roundrobin
|
||
|
|
server stream1 host.docker.internal:8082 check
|
||
|
|
|
||
|
|
backend backend_web
|
||
|
|
balance roundrobin
|
||
|
|
server web1 host.docker.internal:3000 check
|