@@ -252,6 +252,9 @@ echo "Docker configured with HTTPS_PROXY=$scheme://$http_host/"
252
252
proxy_ignore_client_abort on ;
253
253
proxy_cache_revalidate on;
254
254
255
+ # Avoid conversion of HEAD method to GET
256
+ proxy_cache_convert_head off;
257
+
255
258
# Hide/ignore headers from caching. S3 especially likes to send Expires headers in the past in some situations.
256
259
proxy_hide_header Set-Cookie;
257
260
proxy_ignore_headers X-Accel-Expires Expires Cache-Control Set-Cookie;
@@ -278,13 +281,15 @@ echo "Docker configured with HTTPS_PROXY=$scheme://$http_host/"
278
281
# For blob requests by digest, do cache, and treat redirects.
279
282
location ~ ^/v2/(.*)/blobs/sha256:(.*) {
280
283
set $docker_proxy_request_type "blob-by-digest" ;
284
+ set $cache_key $request_method$2 ;
281
285
include "/etc/nginx/nginx.manifest.common.conf" ;
282
286
}
283
287
284
288
# For manifest requests by digest, do cache, and treat redirects.
285
289
# These are some of the requests that DockerHub will throttle.
286
290
location ~ ^/v2/(.*)/manifests/sha256:(.*) {
287
291
set $docker_proxy_request_type "manifest-by-digest" ;
292
+ set $cache_key $request_method$uri ;
288
293
include "/etc/nginx/nginx.manifest.common.conf" ;
289
294
}
290
295
@@ -297,6 +302,7 @@ echo "Docker configured with HTTPS_PROXY=$scheme://$http_host/"
297
302
# Since these are mutable, we invalidate them immediately and keep them only in case the backend is down
298
303
location ~ ^/v2/(.*)/blobs/ {
299
304
set $docker_proxy_request_type "blob-mutable" ;
305
+ set $cache_key $request_method$uri ;
300
306
proxy_cache_valid 0s ;
301
307
include "/etc/nginx/nginx.manifest.stale.conf" ;
302
308
}
@@ -322,7 +328,8 @@ echo "Docker configured with HTTPS_PROXY=$scheme://$http_host/"
322
328
proxy_cache $cache ;
323
329
# But we store the result with the cache key of the original request URI
324
330
# so that future clients don't need to follow the redirect too
325
- proxy_cache_key $original_uri$slice_range ;
331
+ proxy_cache_key $cache_key$slice_range ;
332
+ add_header X-Docker-Registry-Proxy-Cache-Key-Status "$cache_key$slice_range " ;
326
333
}
327
334
328
335
# by default, dont cache anything.
0 commit comments