mirror of
https://github.com/Tecnativa/docker-socket-proxy
synced 2025-01-03 12:20:55 +00:00
79 lines
4.3 KiB
INI
79 lines
4.3 KiB
INI
global
|
|
log stdout format raw daemon "${LOG_LEVEL}"
|
|
|
|
pidfile /run/haproxy.pid
|
|
maxconn 4000
|
|
|
|
# Turn on stats unix socket
|
|
server-state-file /var/lib/haproxy/server-state
|
|
lua-load /usr/local/etc/haproxy/verify.lua
|
|
|
|
defaults
|
|
mode http
|
|
log global
|
|
option httplog
|
|
option dontlognull
|
|
option http-server-close
|
|
option redispatch
|
|
retries 3
|
|
timeout http-request 10s
|
|
timeout queue 1m
|
|
timeout connect 10s
|
|
timeout client 10m
|
|
timeout server 10m
|
|
timeout http-keep-alive 10s
|
|
timeout check 10s
|
|
maxconn 3000
|
|
|
|
# Allow seamless reloads
|
|
load-server-state-from-file global
|
|
|
|
# Use provided example error pages
|
|
errorfile 400 /usr/local/etc/haproxy/errors/400.http
|
|
errorfile 403 /usr/local/etc/haproxy/errors/403.http
|
|
errorfile 408 /usr/local/etc/haproxy/errors/408.http
|
|
errorfile 500 /usr/local/etc/haproxy/errors/500.http
|
|
errorfile 502 /usr/local/etc/haproxy/errors/502.http
|
|
errorfile 503 /usr/local/etc/haproxy/errors/503.http
|
|
errorfile 504 /usr/local/etc/haproxy/errors/504.http
|
|
|
|
backend dockerbackend
|
|
server dockersocket $SOCKET_PATH
|
|
|
|
backend docker-events
|
|
server dockersocket $SOCKET_PATH
|
|
timeout server 0
|
|
|
|
frontend dockerfrontend
|
|
bind ${BIND_CONFIG}
|
|
http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/containers/[a-zA-Z0-9_.-]+/((stop)|(restart)|(kill)) } { env(ALLOW_RESTARTS) -m bool }
|
|
http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/containers/[a-zA-Z0-9_.-]+/start } { env(ALLOW_START) -m bool }
|
|
http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/containers/[a-zA-Z0-9_.-]+/stop } { env(ALLOW_STOP) -m bool }
|
|
http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/containers } { lua.verify_access(CONTAINERS) -m bool }
|
|
http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/exec } { lua.verify_access(EXEC) -m bool }
|
|
http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/images } { lua.verify_access(IMAGES) -m bool }
|
|
http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/networks } { lua.verify_access(NETWORKS) -m bool }
|
|
http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/secrets } { lua.verify_access(SECRETS) -m bool }
|
|
http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/services } { lua.verify_access(SERVICES) -m bool }
|
|
http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/volumes } { lua.verify_access(VOLUMES) -m bool }
|
|
http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/swarm } { lua.verify_access(SWARM) -m bool }
|
|
http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/nodes } { lua.verify_access(NODES) -m bool }
|
|
http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/configs } { lua.verify_access(CONFIGS) -m bool }
|
|
http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/plugins } { lua.verify_access(PLUGINS) -m bool }
|
|
http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/system } { lua.verify_access(SYSTEM) -m bool }
|
|
http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/auth } { lua.verify_access(AUTH) -m bool }
|
|
http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/build } { lua.verify_access(BUILD) -m bool }
|
|
http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/commit } { lua.verify_access(COMMIT) -m bool }
|
|
http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/distribution } { lua.verify_access(DISTRIBUTION) -m bool }
|
|
http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/events } { lua.verify_access(EVENTS) -m bool }
|
|
http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/grpc } { lua.verify_access(GRPC) -m bool }
|
|
http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/info } { lua.verify_access(INFO) -m bool }
|
|
http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/_ping } { lua.verify_access(PING) -m bool }
|
|
http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/session } { lua.verify_access(SESSION) -m bool }
|
|
http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/tasks } { lua.verify_access(TASKS) -m bool }
|
|
http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/version } { lua.verify_access(VERSION) -m bool }
|
|
http-request deny
|
|
default_backend dockerbackend
|
|
|
|
use_backend docker-events if { path,url_dec -m reg -i ^(/v[\d\.]+)?/events }
|