40 lines
1.1 KiB
INI
40 lines
1.1 KiB
INI
global
|
|
maxconn 4096
|
|
user haproxy
|
|
group haproxy
|
|
log 127.0.0.1 local1 debug
|
|
tune.ssl.default-dh-param 2048
|
|
|
|
defaults
|
|
log global
|
|
mode http
|
|
option httplog
|
|
option dontlognull
|
|
retries 3
|
|
option redispatch
|
|
option http-server-close
|
|
option forwardfor
|
|
maxconn 2000
|
|
timeout connect 5s
|
|
timeout client 15min
|
|
timeout server 15min
|
|
|
|
frontend public
|
|
bind :::80 v4v6
|
|
bind :::443 v4v6 ssl crt /opt/haproxy/data/ssl/snakeoil.pem
|
|
option forwardfor except 127.0.0.1
|
|
use_backend webcam if { path_beg /webcam/ }
|
|
default_backend octoprint
|
|
|
|
backend octoprint
|
|
acl needs_scheme req.hdr_cnt(X-Scheme) eq 0
|
|
reqrep ^([^\ :]*)\ /(.*) \1\ /\2
|
|
reqadd X-Scheme:\ https if needs_scheme { ssl_fc }
|
|
reqadd X-Scheme:\ http if needs_scheme !{ ssl_fc }
|
|
option forwardfor
|
|
server octoprint1 octoprint:5000
|
|
|
|
backend webcam
|
|
reqrep ^([^\ :]*)\ /webcam/(.*) \1\ /\2
|
|
server webcam1 webcam:8080
|