diff --git a/roles/haproxy/templates/haproxy.cfg b/roles/haproxy/templates/haproxy.cfg index 010eed12a6..3f213ccd14 100644 --- a/roles/haproxy/templates/haproxy.cfg +++ b/roles/haproxy/templates/haproxy.cfg @@ -351,7 +351,9 @@ frontend oci-registry-frontend backend oci-registry-backend balance hdr(appserver) server oci-registry01 oci-registry01:5000 check inter 10s rise 1 fall 2 +{% if env == "production" %} server oci-registry02 oci-registry02:5000 check inter 10s rise 1 fall 2 +{% endif %} {% if env == "staging" %} diff --git a/roles/httpd/reverseproxy/templates/reversepassproxy.registry-generic.conf b/roles/httpd/reverseproxy/templates/reversepassproxy.registry-generic.conf index a736b39367..77af258e56 100644 --- a/roles/httpd/reverseproxy/templates/reversepassproxy.registry-generic.conf +++ b/roles/httpd/reverseproxy/templates/reversepassproxy.registry-generic.conf @@ -12,7 +12,11 @@ RewriteRule ^/v2/(.*)/blobs/([a-zA-Z0-9:]*) https://cdn.registry.fedoraproject.o # This is terible, but Docker. RewriteCond %{REQUEST_METHOD} ^(PATCH|POST|PUT|DELETE)$ +{% if env == "production" %} RewriteRule ^/v2/(.*)$ http://oci-registry02:5000/v2/$1 [P,L] +{% elif env == "staging" %} +RewriteRule ^/v2/(.*)$ http://oci-registry01:5000/v2/$1 [P,L] +{% endif %} RewriteRule ^/v2/(.*)$ http://localhost:6081/v2/$1 [P,L] DocumentRoot /srv/web/registry-index/