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 <kevin@scrye.com>
This commit is contained in:
Kevin Fenzi 2019-10-16 17:08:53 +00:00 committed by Pierre-Yves Chibon
parent 2965777f28
commit 713979b3a0
2 changed files with 3 additions and 2 deletions

View file

@ -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}}"

View file

@ -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 %}