File tree 3 files changed +8
-1
lines changed
3 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -115,6 +115,7 @@ echo -n "" >/etc/nginx/nginx.manifest.caching.config.conf
115
115
# First tier caching of manifests; configure via MANIFEST_CACHE_PRIMARY_REGEX and MANIFEST_CACHE_PRIMARY_TIME
116
116
location ~ ^/v2/(.*)/manifests/${MANIFEST_CACHE_PRIMARY_REGEX} {
117
117
set \$ docker_proxy_request_type "manifest-primary";
118
+ set \$ cache_key \$ uri;
118
119
proxy_cache_valid ${MANIFEST_CACHE_PRIMARY_TIME} ;
119
120
include "/etc/nginx/nginx.manifest.stale.conf";
120
121
}
124
125
# Secondary tier caching of manifests; configure via MANIFEST_CACHE_SECONDARY_REGEX and MANIFEST_CACHE_SECONDARY_TIME
125
126
location ~ ^/v2/(.*)/manifests/${MANIFEST_CACHE_SECONDARY_REGEX} {
126
127
set \$ docker_proxy_request_type "manifest-secondary";
128
+ set \$ cache_key \$ uri;
127
129
proxy_cache_valid ${MANIFEST_CACHE_SECONDARY_TIME} ;
128
130
include "/etc/nginx/nginx.manifest.stale.conf";
129
131
}
133
135
# Default tier caching for manifests. Caches for ${MANIFEST_CACHE_DEFAULT_TIME} (from MANIFEST_CACHE_DEFAULT_TIME)
134
136
location ~ ^/v2/(.*)/manifests/ {
135
137
set \$ docker_proxy_request_type "manifest-default";
138
+ set \$ cache_key \$ uri;
136
139
proxy_cache_valid ${MANIFEST_CACHE_DEFAULT_TIME} ;
137
140
include "/etc/nginx/nginx.manifest.stale.conf";
138
141
}
142
145
# Manifest caching is disabled. Enable it with ENABLE_MANIFEST_CACHE=true
143
146
location ~ ^/v2/(.*)/manifests/ {
144
147
set \$ docker_proxy_request_type "manifest-default-disabled";
148
+ set \$ cache_key \$ uri;
145
149
proxy_cache_valid 0s;
146
150
include "/etc/nginx/nginx.manifest.stale.conf";
147
151
}
Original file line number Diff line number Diff line change @@ -266,13 +266,15 @@ echo "Docker configured with HTTPS_PROXY=$scheme://$http_host/"
266
266
# For blob requests by digest, do cache, and treat redirects.
267
267
location ~ ^/v2/(.*)/blobs/sha256:(.*) {
268
268
set $docker_proxy_request_type "blob-by-digest" ;
269
+ set $cache_key $2 ;
269
270
include "/etc/nginx/nginx.manifest.common.conf" ;
270
271
}
271
272
272
273
# For manifest requests by digest, do cache, and treat redirects.
273
274
# These are some of the requests that DockerHub will throttle.
274
275
location ~ ^/v2/(.*)/manifests/sha256:(.*) {
275
276
set $docker_proxy_request_type "manifest-by-digest" ;
277
+ set $cache_key $uri ;
276
278
include "/etc/nginx/nginx.manifest.common.conf" ;
277
279
}
278
280
@@ -285,6 +287,7 @@ echo "Docker configured with HTTPS_PROXY=$scheme://$http_host/"
285
287
# Since these are mutable, we invalidate them immediately and keep them only in case the backend is down
286
288
location ~ ^/v2/(.*)/blobs/ {
287
289
set $docker_proxy_request_type "blob-mutable" ;
290
+ set $cache_key $uri ;
288
291
proxy_cache_valid 0s ;
289
292
include "/etc/nginx/nginx.manifest.stale.conf" ;
290
293
}
Original file line number Diff line number Diff line change 3
3
add_header X-Docker-Registry-Proxy-Cache-Type "$docker_proxy_request_type";
4
4
proxy_pass https://$targetHost;
5
5
proxy_cache cache;
6
- proxy_cache_key $uri ;
6
+ proxy_cache_key $cache_key ;
7
7
proxy_intercept_errors on;
8
8
error_page 301 302 307 = @handle_redirects;
You can’t perform that action at this time.
0 commit comments