From: Kevin Fenzi <kevin(a)scrye.com>
This is the same as the last version, except we add a [OR] to make sure we match
if the connection is not via cdn and also the host is not registry-no-cdn.
Hopefully this will do it. :)
Signed-off-by: Kevin Fenzi <kevin(a)scrye.com>
---
playbooks/include/proxies-websites.yml | 2 +-
.../reverseproxy/templates/reversepassproxy.registry-generic.conf | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/playbooks/include/proxies-websites.yml
b/playbooks/include/proxies-websites.yml
index 8dd1740..c87677f 100644
--- a/playbooks/include/proxies-websites.yml
+++ b/playbooks/include/proxies-websites.yml
@@ -666,7 +666,7 @@
- role: httpd/website
site_name:
registry.fedoraproject.org
- server_aliases: [
registry.stg.fedoraproject.org]
+ server_aliases: [
registry.stg.fedoraproject.org registry-no-cdn.fedoraproject.org]
sslonly: true
cert_name: "{{wildcard_cert_name}}"
diff --git a/roles/httpd/reverseproxy/templates/reversepassproxy.registry-generic.conf
b/roles/httpd/reverseproxy/templates/reversepassproxy.registry-generic.conf
index 8a97f39..b7102e5 100644
--- a/roles/httpd/reverseproxy/templates/reversepassproxy.registry-generic.conf
+++ b/roles/httpd/reverseproxy/templates/reversepassproxy.registry-generic.conf
@@ -5,7 +5,8 @@ ProxyPreserveHost On
{% if env == "production" %}
-RewriteCond %{HTTP:VIA} !cdn77
+RewriteCond %{HTTP:VIA} !cdn77 [OR]
+RewriteCond %{SERVER_NAME} !/^registry-no-cdn.fedoraproject.org$/
RewriteCond %{REQUEST_METHOD} !^(PATCH|POST|PUT|DELETE|HEAD)$
RewriteRule ^/v2/(.*)/blobs/([a-zA-Z0-9:]*)
https://cdn.registry.fedoraproject.org/v2/$1/blobs/$2 [R]
{% endif %}
--
1.8.3.1