Re: [PATCH] proxies: add registry-no-cdn in a better/simplier way

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



+1 to this version of it, with the removal of the /'s in the regex which I think Apache would take literally.

If we want to be pedantic, then escape the .'s in the regex with a \, but in this case it doesn't matter much.

-re


On 2019-10-15 14:19, kevin@xxxxxxxxx wrote:
From: Kevin Fenzi <kevin@xxxxxxxxx>

This version is just two lines. Adding a host alias to registry so it uses the same
vhost there, and then checking for the hostname in the rewrite.

Signed-off-by: Kevin Fenzi <kevin@xxxxxxxxx>
---
  playbooks/include/proxies-websites.yml                                  | 2 +-
  .../httpd/reverseproxy/templates/reversepassproxy.registry-generic.conf | 1 +
  2 files changed, 2 insertions(+), 1 deletion(-)

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..9bc9eba 100644
--- a/roles/httpd/reverseproxy/templates/reversepassproxy.registry-generic.conf
+++ b/roles/httpd/reverseproxy/templates/reversepassproxy.registry-generic.conf
@@ -6,6 +6,7 @@ ProxyPreserveHost On
{% if env == "production" %}
  RewriteCond %{HTTP:VIA} !cdn77
+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 %}

_______________________________________________
infrastructure mailing list -- infrastructure@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to infrastructure-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/infrastructure@xxxxxxxxxxxxxxxxxxxxxxx




[Index of Archives]     [Fedora Development]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]

  Powered by Linux