Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions root/templates/haproxy.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ backend docker

frontend proxy
bind @@BIND_PROTO@@
# Docker's archive extraction endpoint only consumes tar request bodies when
# their media type is application/x-tar. Supply the documented media type
# when clients omit Content-Type rather than forwarding a request that the
# daemon acknowledges with 200 while extracting nothing.
http-request set-header Content-Type application/x-tar if METH_PUT { path,url_dec -m reg -i ^(/v[\d\.]+)?/containers/[a-zA-Z0-9_.-]+/archive$ } !{ req.hdr(Content-Type) -m found }
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 }
Expand Down