Put staging stable registry behind varnish and redirect to external registry
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
This commit is contained in:
parent
34530570e5
commit
a7d6b0052f
3 changed files with 19 additions and 0 deletions
|
@ -550,6 +550,13 @@
|
||||||
website: registry.fedoraproject.org
|
website: registry.fedoraproject.org
|
||||||
destname: registry
|
destname: registry
|
||||||
proxyurl: http://localhost:10048
|
proxyurl: http://localhost:10048
|
||||||
|
when: env == "production"
|
||||||
|
|
||||||
|
- role: httpd/reverseproxy
|
||||||
|
website: registry.fedoraproject.org
|
||||||
|
destname: registry
|
||||||
|
proxyurl: "{{ varnish_url }}"
|
||||||
|
when: env == "staging"
|
||||||
|
|
||||||
- role: httpd/reverseproxy
|
- role: httpd/reverseproxy
|
||||||
website: candidate-registry.fedoraproject.org
|
website: candidate-registry.fedoraproject.org
|
||||||
|
|
|
@ -3,6 +3,10 @@ RequestHeader set X-Scheme https early
|
||||||
RequestHeader set X-Forwarded-Proto https early
|
RequestHeader set X-Forwarded-Proto https early
|
||||||
ProxyPreserveHost On
|
ProxyPreserveHost On
|
||||||
|
|
||||||
|
{% if env == "staging" %}
|
||||||
|
RewriteRule ^/v2/([a-zA-Z]*)/blobs/([a-zA-Z]*) https://ourregistry/v2/$1/blobs/$2 [R]
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
ProxyPass {{ localpath }} {{ proxyurl }}{{remotepath}}
|
ProxyPass {{ localpath }} {{ proxyurl }}{{remotepath}}
|
||||||
ProxyPassReverse {{ localpath }} {{ proxyurl }}{{remotepath}}
|
ProxyPassReverse {{ localpath }} {{ proxyurl }}{{remotepath}}
|
||||||
|
|
||||||
|
|
|
@ -140,6 +140,11 @@ backend koschei {
|
||||||
.port = "10040";
|
.port = "10040";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
backend registry {
|
||||||
|
.host = "localhost";
|
||||||
|
.port = "10048";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
acl purge {
|
acl purge {
|
||||||
"192.168.1.129"; // wiki01.vpn
|
"192.168.1.129"; // wiki01.vpn
|
||||||
|
@ -186,6 +191,9 @@ sub vcl_recv {
|
||||||
return(purge);
|
return(purge);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (req.http.X-Forwarded-Server ~ "^registry.fedoraproject.org" || req.http.X-Forwarded-Server ~ "^registry.stg.fedoraproject.org") {
|
||||||
|
set req.backend_hint = registry;
|
||||||
|
}
|
||||||
if (req.url ~ "^/wiki/") {
|
if (req.url ~ "^/wiki/") {
|
||||||
set req.backend_hint = wiki;
|
set req.backend_hint = wiki;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue