Use a static Apache config for registries
We should be able to accomplish the registry redirect using a single rewrite rule and a single empty file. Change-Id: I85a09d19bbbad1ba7078076644a3c5cea4d8aeb8
This commit is contained in:
@@ -27,16 +27,15 @@
|
|||||||
SSLCertificateKeyFile /etc/letsencrypt-certs/registry.zuul-ci.org/registry.zuul-ci.org.key
|
SSLCertificateKeyFile /etc/letsencrypt-certs/registry.zuul-ci.org/registry.zuul-ci.org.key
|
||||||
SSLCertificateChainFile /etc/letsencrypt-certs/registry.zuul-ci.org/ca.cer
|
SSLCertificateChainFile /etc/letsencrypt-certs/registry.zuul-ci.org/ca.cer
|
||||||
|
|
||||||
DocumentRoot /afs/openstack.org/project/zuul-ci.org/registry
|
DocumentRoot /var/www/registry
|
||||||
<Directory /afs/openstack.org/project/zuul-ci.org/registry>
|
<Directory /var/www/registry>
|
||||||
Options Indexes FollowSymLinks MultiViews
|
Options Indexes FollowSymLinks MultiViews
|
||||||
Require all granted
|
Require all granted
|
||||||
AllowOverride None
|
AllowOverride None
|
||||||
# Allow mod_rewrite rules
|
|
||||||
AllowOverrideList Redirect RedirectMatch
|
|
||||||
ErrorDocument 404 /errorpage.html
|
|
||||||
</Directory>
|
</Directory>
|
||||||
|
|
||||||
|
RewriteRule ^/v2/(.*)$ https://quay.io/v2/corvus/$1 [R=302,L]
|
||||||
|
|
||||||
ErrorLog /var/log/apache2/registry.zuul-ci.org_error.log
|
ErrorLog /var/log/apache2/registry.zuul-ci.org_error.log
|
||||||
LogLevel warn
|
LogLevel warn
|
||||||
CustomLog /var/log/apache2/registry.zuul-ci.org_access.log combined
|
CustomLog /var/log/apache2/registry.zuul-ci.org_access.log combined
|
||||||
|
|||||||
@@ -85,6 +85,22 @@
|
|||||||
args:
|
args:
|
||||||
removes: /etc/apache2/sites-enabled/000-default.conf
|
removes: /etc/apache2/sites-enabled/000-default.conf
|
||||||
|
|
||||||
|
- name: Make a local empty directory for registry roots
|
||||||
|
file:
|
||||||
|
state: directory
|
||||||
|
path: /var/www/registry/v2
|
||||||
|
mode: 0755
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
|
||||||
|
- name: Make a local empty index file for registry roots
|
||||||
|
copy:
|
||||||
|
content: ""
|
||||||
|
dest: /var/www/registry/v2/index.html
|
||||||
|
mode: 0644
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
|
||||||
- name: Enable sites
|
- name: Enable sites
|
||||||
include_tasks: enable_site.yaml
|
include_tasks: enable_site.yaml
|
||||||
loop:
|
loop:
|
||||||
|
|||||||
Reference in New Issue
Block a user