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 @@ -111,6 +111,7 @@ echo -n "" >/etc/nginx/nginx.manifest.caching.config.conf
111
111
# First tier caching of manifests; configure via MANIFEST_CACHE_PRIMARY_REGEX and MANIFEST_CACHE_PRIMARY_TIME
112
112
location ~ ^/v2/(.*)/manifests/${MANIFEST_CACHE_PRIMARY_REGEX} {
113
113
set \$ docker_proxy_request_type "manifest-primary";
114
+ set \$ cache_key \$ uri;
114
115
proxy_cache_valid ${MANIFEST_CACHE_PRIMARY_TIME} ;
115
116
include "/etc/nginx/nginx.manifest.stale.conf";
116
117
}
120
121
# Secondary tier caching of manifests; configure via MANIFEST_CACHE_SECONDARY_REGEX and MANIFEST_CACHE_SECONDARY_TIME
121
122
location ~ ^/v2/(.*)/manifests/${MANIFEST_CACHE_SECONDARY_REGEX} {
122
123
set \$ docker_proxy_request_type "manifest-secondary";
124
+ set \$ cache_key \$ uri;
123
125
proxy_cache_valid ${MANIFEST_CACHE_SECONDARY_TIME} ;
124
126
include "/etc/nginx/nginx.manifest.stale.conf";
125
127
}
129
131
# Default tier caching for manifests. Caches for ${MANIFEST_CACHE_DEFAULT_TIME} (from MANIFEST_CACHE_DEFAULT_TIME)
130
132
location ~ ^/v2/(.*)/manifests/ {
131
133
set \$ docker_proxy_request_type "manifest-default";
134
+ set \$ cache_key \$ uri;
132
135
proxy_cache_valid ${MANIFEST_CACHE_DEFAULT_TIME} ;
133
136
include "/etc/nginx/nginx.manifest.stale.conf";
134
137
}
138
141
# Manifest caching is disabled. Enable it with ENABLE_MANIFEST_CACHE=true
139
142
location ~ ^/v2/(.*)/manifests/ {
140
143
set \$ docker_proxy_request_type "manifest-default-disabled";
144
+ set \$ cache_key \$ uri;
141
145
proxy_cache_valid 0s;
142
146
include "/etc/nginx/nginx.manifest.stale.conf";
143
147
}
Original file line number Diff line number Diff line change @@ -262,13 +262,15 @@ echo "Docker configured with HTTPS_PROXY=$scheme://$http_host/"
262
262
# For blob requests by digest, do cache, and treat redirects.
263
263
location ~ ^/v2/(.*)/blobs/sha256:(.*) {
264
264
set $docker_proxy_request_type "blob-by-digest" ;
265
+ set $cache_key $2 ;
265
266
include "/etc/nginx/nginx.manifest.common.conf" ;
266
267
}
267
268
268
269
# For manifest requests by digest, do cache, and treat redirects.
269
270
# These are some of the requests that DockerHub will throttle.
270
271
location ~ ^/v2/(.*)/manifests/sha256:(.*) {
271
272
set $docker_proxy_request_type "manifest-by-digest" ;
273
+ set $cache_key $uri ;
272
274
include "/etc/nginx/nginx.manifest.common.conf" ;
273
275
}
274
276
@@ -281,6 +283,7 @@ echo "Docker configured with HTTPS_PROXY=$scheme://$http_host/"
281
283
# Since these are mutable, we invalidate them immediately and keep them only in case the backend is down
282
284
location ~ ^/v2/(.*)/blobs/ {
283
285
set $docker_proxy_request_type "blob-mutable" ;
286
+ set $cache_key $uri ;
284
287
proxy_cache_valid 0s ;
285
288
include "/etc/nginx/nginx.manifest.stale.conf" ;
286
289
}
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