From 53d9ee0732f9e9b47911d21d0cb7cf3517b72cdb Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Wed, 29 Mar 2017 13:11:26 +0200 Subject: [PATCH] :sparkles: Support any API version prefix --- haproxy.cfg | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/haproxy.cfg b/haproxy.cfg index c8b36b8..abefcc6 100644 --- a/haproxy.cfg +++ b/haproxy.cfg @@ -42,24 +42,24 @@ backend dockerbackend frontend dockerfrontend bind :2375 http-request deny unless METH_GET || { env(POST) -m bool } - http-request deny if { path_reg ^(/v\d+.\d+)?/auth } ! { env(AUTH) -m bool } - http-request deny if { path_reg ^(/v\d+.\d+)?/build } ! { env(BUILD) -m bool } - http-request deny if { path_reg ^(/v\d+.\d+)?/commit } ! { env(COMMIT) -m bool } - http-request deny if { path_reg ^(/v\d+.\d+)?/containers } ! { env(CONTAINERS) -m bool } - http-request deny if { path_reg ^(/v\d+.\d+)?/events } ! { env(EVENTS) -m bool } - http-request deny if { path_reg ^(/v\d+.\d+)?/exec } ! { env(EXEC) -m bool } - http-request deny if { path_reg ^(/v\d+.\d+)?/images } ! { env(IMAGES) -m bool } - http-request deny if { path_reg ^(/v\d+.\d+)?/info } ! { env(INFO) -m bool } - http-request deny if { path_reg ^(/v\d+.\d+)?/networks } ! { env(NETWORKS) -m bool } - http-request deny if { path_reg ^(/v\d+.\d+)?/nodes } ! { env(NODES) -m bool } - http-request deny if { path_reg ^(/v\d+.\d+)?/_ping } ! { env(PING) -m bool } - http-request deny if { path_reg ^(/v\d+.\d+)?/plugins } ! { env(PLUGINS) -m bool } - http-request deny if { path_reg ^(/v\d+.\d+)?/post } ! { env(POST) -m bool } - http-request deny if { path_reg ^(/v\d+.\d+)?/secrets } ! { env(SECRETS) -m bool } - http-request deny if { path_reg ^(/v\d+.\d+)?/services } ! { env(SERVICES) -m bool } - http-request deny if { path_reg ^(/v\d+.\d+)?/swarm } ! { env(SWARM) -m bool } - http-request deny if { path_reg ^(/v\d+.\d+)?/system } ! { env(SYSTEM) -m bool } - http-request deny if { path_reg ^(/v\d+.\d+)?/tasks } ! { env(TASKS) -m bool } - http-request deny if { path_reg ^(/v\d+.\d+)?/version } ! { env(VERSION) -m bool } - http-request deny if { path_reg ^(/v\d+.\d+)?/volumes } ! { env(VOLUMES) -m bool } + http-request deny if { path_reg ^(/v[\d\.]+)?/auth } ! { env(AUTH) -m bool } + http-request deny if { path_reg ^(/v[\d\.]+)?/build } ! { env(BUILD) -m bool } + http-request deny if { path_reg ^(/v[\d\.]+)?/commit } ! { env(COMMIT) -m bool } + http-request deny if { path_reg ^(/v[\d\.]+)?/containers } ! { env(CONTAINERS) -m bool } + http-request deny if { path_reg ^(/v[\d\.]+)?/events } ! { env(EVENTS) -m bool } + http-request deny if { path_reg ^(/v[\d\.]+)?/exec } ! { env(EXEC) -m bool } + http-request deny if { path_reg ^(/v[\d\.]+)?/images } ! { env(IMAGES) -m bool } + http-request deny if { path_reg ^(/v[\d\.]+)?/info } ! { env(INFO) -m bool } + http-request deny if { path_reg ^(/v[\d\.]+)?/networks } ! { env(NETWORKS) -m bool } + http-request deny if { path_reg ^(/v[\d\.]+)?/nodes } ! { env(NODES) -m bool } + http-request deny if { path_reg ^(/v[\d\.]+)?/_ping } ! { env(PING) -m bool } + http-request deny if { path_reg ^(/v[\d\.]+)?/plugins } ! { env(PLUGINS) -m bool } + http-request deny if { path_reg ^(/v[\d\.]+)?/post } ! { env(POST) -m bool } + http-request deny if { path_reg ^(/v[\d\.]+)?/secrets } ! { env(SECRETS) -m bool } + http-request deny if { path_reg ^(/v[\d\.]+)?/services } ! { env(SERVICES) -m bool } + http-request deny if { path_reg ^(/v[\d\.]+)?/swarm } ! { env(SWARM) -m bool } + http-request deny if { path_reg ^(/v[\d\.]+)?/system } ! { env(SYSTEM) -m bool } + http-request deny if { path_reg ^(/v[\d\.]+)?/tasks } ! { env(TASKS) -m bool } + http-request deny if { path_reg ^(/v[\d\.]+)?/version } ! { env(VERSION) -m bool } + http-request deny if { path_reg ^(/v[\d\.]+)?/volumes } ! { env(VOLUMES) -m bool } default_backend dockerbackend