From 713979b3a086dd29b66b8edce16d95e8b544e74b Mon Sep 17 00:00:00 2001 From: Kevin Fenzi Date: Wed, 16 Oct 2019 17:08:53 +0000 Subject: [PATCH] proxies: add registry-no-cdn host to proxies This host shares with registry vhost, but if it's used it bypasses downloading from the cdn. We need this internally on composes that download flatpaks. They need to get them direct from our registry and not from an external cdn. Signed-off-by: Kevin Fenzi --- playbooks/include/proxies-websites.yml | 2 +- .../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 8dd17404a2..c87677f638 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 8a97f39afa..26866abf27 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 %}