File tree Expand file tree Collapse file tree 3 files changed +8
-1
lines changed Expand file tree Collapse file tree 3 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -153,6 +153,7 @@ echo -n "" >/etc/nginx/nginx.manifest.caching.config.conf
153
153
# First tier caching of manifests; configure via MANIFEST_CACHE_PRIMARY_REGEX and MANIFEST_CACHE_PRIMARY_TIME
154
154
location ~ ^/v2/(.*)/manifests/${MANIFEST_CACHE_PRIMARY_REGEX} {
155
155
set \$ docker_proxy_request_type "manifest-primary";
156
+ set \$ cache_key \$ uri;
156
157
proxy_cache_valid ${MANIFEST_CACHE_PRIMARY_TIME} ;
157
158
include "/etc/nginx/nginx.manifest.stale.conf";
158
159
}
162
163
# Secondary tier caching of manifests; configure via MANIFEST_CACHE_SECONDARY_REGEX and MANIFEST_CACHE_SECONDARY_TIME
163
164
location ~ ^/v2/(.*)/manifests/${MANIFEST_CACHE_SECONDARY_REGEX} {
164
165
set \$ docker_proxy_request_type "manifest-secondary";
166
+ set \$ cache_key \$ uri;
165
167
proxy_cache_valid ${MANIFEST_CACHE_SECONDARY_TIME} ;
166
168
include "/etc/nginx/nginx.manifest.stale.conf";
167
169
}
171
173
# Default tier caching for manifests. Caches for ${MANIFEST_CACHE_DEFAULT_TIME} (from MANIFEST_CACHE_DEFAULT_TIME)
172
174
location ~ ^/v2/(.*)/manifests/ {
173
175
set \$ docker_proxy_request_type "manifest-default";
176
+ set \$ cache_key \$ uri;
174
177
proxy_cache_valid ${MANIFEST_CACHE_DEFAULT_TIME} ;
175
178
include "/etc/nginx/nginx.manifest.stale.conf";
176
179
}
180
183
# Manifest caching is disabled. Enable it with ENABLE_MANIFEST_CACHE=true
181
184
location ~ ^/v2/(.*)/manifests/ {
182
185
set \$ docker_proxy_request_type "manifest-default-disabled";
186
+ set \$ cache_key \$ uri;
183
187
proxy_cache_valid 0s;
184
188
include "/etc/nginx/nginx.manifest.stale.conf";
185
189
}
Original file line number Diff line number Diff line change @@ -275,13 +275,15 @@ echo "Docker configured with HTTPS_PROXY=$scheme://$http_host/"
275
275
# For blob requests by digest, do cache, and treat redirects.
276
276
location ~ ^/v2/(.*)/blobs/sha256:(.*) {
277
277
set $docker_proxy_request_type "blob-by-digest" ;
278
+ set $cache_key $2 ;
278
279
include "/etc/nginx/nginx.manifest.common.conf" ;
279
280
}
280
281
281
282
# For manifest requests by digest, do cache, and treat redirects.
282
283
# These are some of the requests that DockerHub will throttle.
283
284
location ~ ^/v2/(.*)/manifests/sha256:(.*) {
284
285
set $docker_proxy_request_type "manifest-by-digest" ;
286
+ set $cache_key $uri ;
285
287
include "/etc/nginx/nginx.manifest.common.conf" ;
286
288
}
287
289
@@ -294,6 +296,7 @@ echo "Docker configured with HTTPS_PROXY=$scheme://$http_host/"
294
296
# Since these are mutable, we invalidate them immediately and keep them only in case the backend is down
295
297
location ~ ^/v2/(.*)/blobs/ {
296
298
set $docker_proxy_request_type "blob-mutable" ;
299
+ set $cache_key $uri ;
297
300
proxy_cache_valid 0s ;
298
301
include "/etc/nginx/nginx.manifest.stale.conf" ;
299
302
}
Original file line number Diff line number Diff line change 4
4
proxy_pass https://$targetHost;
5
5
proxy_cache $cache;
6
6
slice 4m;
7
- proxy_cache_key $uri $slice_range;
7
+ proxy_cache_key $cache_key $slice_range;
8
8
proxy_set_header Range $slice_range;
9
9
proxy_http_version 1.1;
10
10
proxy_intercept_errors on;
You can’t perform that action at this time.
0 commit comments