diff --git a/proxyexamples/haproxy/haproxy-ha.cfg b/proxyexamples/haproxy/haproxy-ha.cfg index 18eaefc..3a7c87f 100644 --- a/proxyexamples/haproxy/haproxy-ha.cfg +++ b/proxyexamples/haproxy/haproxy-ha.cfg @@ -21,11 +21,12 @@ defaults retries 3 option redispatch maxconn 256000 - contimeout 5000 - clitimeout 50000 - srvtimeout 50000 + timeout connect 5s + timeout client 50s + timeout server 50s -listen artifactory_http 10.80.166.106:80 +listen artifactory_http + bind :::80 v4v6 mode http balance roundrobin cookie SERVERID insert indirect nocache diff --git a/proxyexamples/haproxy/haproxy-ports.cfg b/proxyexamples/haproxy/haproxy-ports.cfg index 17a3156..1aa1344 100644 --- a/proxyexamples/haproxy/haproxy-ports.cfg +++ b/proxyexamples/haproxy/haproxy-ports.cfg @@ -11,39 +11,35 @@ frontend normal bind *:80 bind *:443 ssl crt /etc/haproxy/ssl mode http - option forwardfor - reqadd X-Forwarded-Proto:\ https if { ssl_fc } option forwardfor header X-Real-IP - reqirep ^([^\ :]*)\ /v2(.*$) \1\ /artifactory/api/docker/docker-virtual/v2\2 + http-request add-header X-Forwarded-Proto https if { ssl_fc } + http-request replace-path /v2(.*$) /artifactory/api/docker/docker-virtual/v2\1 default_backend normal frontend dockerhub bind *:5001 ssl crt /etc/haproxy/ssl mode http - option forwardfor - reqadd X-Forwarded-Proto:\ https if { ssl_fc } option forwardfor header X-Real-IP - reqirep ^([^\ :]*)\ /v2(.*$) \1\ /artifactory/api/docker/docker-remote/v2\2 + http-request add-header X-Forwarded-Proto https if { ssl_fc } + http-request replace-path /v2(.*$) /artifactory/api/docker/docker-remote/v2\1 default_backend normal frontend dockerprod bind *:5001 ssl crt /etc/haproxy/ssl mode http - option forwardfor - reqadd X-Forwarded-Proto:\ https if { ssl_fc } option forwardfor header X-Real-IP - reqirep ^([^\ :]*)\ /v1(.*$) \1\ /artifactory/api/docker/docker-prod-local/v1\2 - reqirep ^([^\ :]*)\ /v2(.*$) \1\ /artifactory/api/docker/docker-prod-local2/v2\2 + http-request add-header X-Forwarded-Proto https if { ssl_fc } + http-request replace-path /v1(.*$) /artifactory/api/docker/docker-prod-local/v1\1 + http-request replace-path /v2(.*$) /artifactory/api/docker/docker-prod-local2/v2\1 default_backend normal frontend dockerdev bind *:5002 ssl crt /etc/haproxy/ssl mode http - option forwardfor - reqadd X-Forwarded-Proto:\ https if { ssl_fc } option forwardfor header X-Real-IP - reqirep ^([^\ :]*)\ /v1(.*$) \1\ /artifactory/api/docker/docker-dev-local/v1\2 - reqirep ^([^\ :]*)\ /v2(.*$) \1\ /artifactory/api/docker/docker-dev-local2/v2\2 + http-request add-header X-Forwarded-Proto https if { ssl_fc } + http-request replace-path /v1(.*$) /artifactory/api/docker/docker-dev-local/v1\1 + http-request replace-path /v2(.*$) /artifactory/api/docker/docker-dev-local2/v2\1 default_backend normal backend normal diff --git a/proxyexamples/haproxy/haproxy-subdomains-2.cfg b/proxyexamples/haproxy/haproxy-subdomains-2.cfg index 5feeead..24c5f69 100644 --- a/proxyexamples/haproxy/haproxy-subdomains-2.cfg +++ b/proxyexamples/haproxy/haproxy-subdomains-2.cfg @@ -2,12 +2,13 @@ frontend normal bind *:443 ssl crt /usr/local/etc/haproxy/ssl/my-cert.pem mode http option forwardfor + option forwardfor header X-Real-IP acl is_docker_request path_beg -i /v2/ + http-request set-var(req.subdomain) req.hdr(host),lower,regsub(\.artifactory\.test\.com$,) if { hdr_end(host) -i .artifactory.test.com } http-request set-header X-Artifactory-Override-Base-Url https://%[hdr(host)]/artifactory http-request set-path /artifactory/api/docker/%[var(req.subdomain)]%[path] if is_docker_request - reqadd X-Forwarded-Proto:\ https - option forwardfor header X-Real-IP + http-request add-header X-Forwarded-Proto https if { ssl_fc } default_backend normal backend normal diff --git a/proxyexamples/haproxy/haproxy-subdomains.cfg b/proxyexamples/haproxy/haproxy-subdomains.cfg index ee23baf..f2151ff 100644 --- a/proxyexamples/haproxy/haproxy-subdomains.cfg +++ b/proxyexamples/haproxy/haproxy-subdomains.cfg @@ -2,9 +2,9 @@ frontend normal bind *:80 bind *:443 ssl crt /etc/haproxy/ssl mode http - option forwarder - reqadd X-Forwarded-Proto:\ https if { ssl_fc } option forwardfor header X-Real-IP + http-request add-header X-Forwarded-Proto https if { ssl_fc } + acl n hdr_end(host) -i .dockertest.test http-request set-var(sess.var) req.hdr(Host),field(1,"."),lower http-request set-header X-Artifactory-Override-Base-Url https://%[hdr(host)]/artifactory @@ -13,8 +13,8 @@ frontend normal backend test mode http - server localhost 127.0.0.1:8081 http-request set-path /artifactory/api/docker/%[var(sess.var)]%[path] + server localhost 127.0.0.1:8081 backend normal mode http