diff --git a/roles/httpd/reverseproxy/templates/reversepassproxy.registry-generic.conf b/roles/httpd/reverseproxy/templates/reversepassproxy.registry-generic.conf
index e41bdcf7e6..c0a456c7ef 100644
--- a/roles/httpd/reverseproxy/templates/reversepassproxy.registry-generic.conf
+++ b/roles/httpd/reverseproxy/templates/reversepassproxy.registry-generic.conf
@@ -32,6 +32,7 @@ RewriteRule ^/v2/(.*)$ http://oci-registry01:5000/v2/$1 [P,L]
{% endif %}
RewriteRule ^/v2/(.*)$ http://localhost:10048/v2/$1 [P,L]
+{% if env == "production" %}
RewriteCond "&%{QUERY_STRING}" &annotation(%3A|:)org.flatpak.ref(%3A|:)exists=1
RewriteCond "&%{QUERY_STRING}" &tag=testing
RewriteCond "&%{QUERY_STRING}" &architecture=([^&]+)
@@ -63,6 +64,39 @@ RewriteRule "^/index/static$" /index/flatpak.json [L,PT]
RewriteCond "&%{QUERY_STRING}" &label(%3A|:)org.flatpak.ref(%3A|:)exists=1
RewriteRule "^/index/static$" /index/flatpak-labels.json [L,PT]
+{% elif env == "staging" %}
+RewriteCond "&%{QUERY_STRING}" &label(%3A|:)org.flatpak.ref(%3A|:)exists=1
+RewriteCond "&%{QUERY_STRING}" &tag=testing
+RewriteCond "&%{QUERY_STRING}" &architecture=([^&]+)
+RewriteRule "^/index/static$" /index/flatpak-testing-%1.json [L,PT]
+
+RewriteCond "&%{QUERY_STRING}" &annotation(%3A|:)org.flatpak.ref(%3A|:)exists=1
+RewriteCond "&%{QUERY_STRING}" &tag=testing
+RewriteCond "&%{QUERY_STRING}" &architecture=([^&]+)
+RewriteRule "^/index/static$" /index/flatpak-testing-%1-annotations.json [L,PT]
+
+RewriteCond "&%{QUERY_STRING}" &label(%3A|:)org.flatpak.ref(%3A|:)exists=1
+RewriteCond "&%{QUERY_STRING}" &architecture=([^&]+)
+RewriteRule "^/index/static$" /index/flatpak-%1.json [L,PT]
+
+RewriteCond "&%{QUERY_STRING}" &annotation(%3A|:)org.flatpak.ref(%3A|:)exists=1
+RewriteCond "&%{QUERY_STRING}" &architecture=([^&]+)
+RewriteRule "^/index/static$" /index/flatpak-%1-annotations.json [L,PT]
+
+RewriteCond "&%{QUERY_STRING}" &label(%3A|:)org.flatpak.ref(%3A|:)exists=1
+RewriteCond "&%{QUERY_STRING}" &tag=testing
+RewriteRule "^/index/static$" /index/flatpak-testing.json [L,PT]
+
+RewriteCond "&%{QUERY_STRING}" &annotation(%3A|:)org.flatpak.ref(%3A|:)exists=1
+RewriteCond "&%{QUERY_STRING}" &tag=testing
+RewriteRule "^/index/static$" /index/flatpak-testing-annotations.json [L,PT]
+
+RewriteCond "&%{QUERY_STRING}" &label(%3A|:)org.flatpak.ref(%3A|:)exists=1
+RewriteRule "^/index/static$" /index/flatpak.json [L,PT]
+
+RewriteCond "&%{QUERY_STRING}" &annotation(%3A|:)org.flatpak.ref(%3A|:)exists=1
+RewriteRule "^/index/static$" /index/flatpak-annotations.json [L,PT]
+{% endif %}
DocumentRoot /srv/web/registry-index/
@@ -87,6 +121,9 @@ SSLOptions +FakeBasicAuth
Alias "/index/" "/srv/web/registry-index/index/"
Alias "/app-icons/" "/srv/web/registry-index/icons/"
+{% if env == "staging" %}
+Alias "/deltas/" "/srv/web/registry-index/deltas/"
+{% endif %}
Options +FollowSymLinks
@@ -106,3 +143,14 @@ Alias "/app-icons/" "/srv/web/registry-index/icons/"
Options +Indexes
Require all granted
+
+{% if env == "staging" %}
+
+ ExpiresActive on
+ ExpiresDefault "access plus 1 year"
+
+ AllowOverride None
+ Options +Indexes
+ Require all granted
+
+{% endif %}