You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
completely reworked caching, now cache by exception (/blobs/ only essentially)
- now only /v2/.../blobs/... URIs are actually cached (together with their redirect catchers)
- /manifests/, /token, and /v2/ are not cached anymore, which should solve a lot of problems
- better messages for /v1 attempts
- fix usage of $connect_host:443 (which is hostname:port and causes errors to be logged) to $connect_addr (which returns an IP:port) in the proxy layer
# @TODO: actually for auth.docker.io, if we want to support multiple authentications, we'll need to decide
64
+
# @TODO: based not only on the hostname, but also URI (/token) and query string (?scope)
65
+
# @TODO: I wonder if this would help gcr.io and quay.io with authentication also....
66
+
67
+
map$dockerAuth$finalAuth {
68
+
"""$http_authorization"; # if empty, keep the original passed-in from the docker client.
69
+
default"Basic $dockerAuth"; # if not empty, add the Basic preamble to the auth
70
+
}
71
+
72
+
54
73
# Map to decide which hosts get directed to the caching portion.
55
74
# This is automatically generated from the list of cached registries, plus a few fixed hosts
56
75
# By default, we don't intercept, allowing free flow of non-registry traffic
57
76
map$connect_host$interceptedHost {
58
77
hostnames;
59
78
include /etc/nginx/docker.intercept.map;
60
-
default"$connect_host:443";
61
-
}
62
-
63
-
map$dockerAuth$finalAuth {
64
-
"""$http_authorization"; # if empty, keep the original passed-in from the client
65
-
default"Basic $dockerAuth"; # if not empty, add the Basic preamble to the auth
79
+
default"$connect_addr"; # $connect_addr is 'IP address and port of the remote host, e.g. "192.168.1.5:12345". IP address is resolved from host name of CONNECT request line.'
# Docker-client should start with v2 and fallback to v1 if something fails, for example, if authentication failed to a protected v2 resource.
175
186
location/v1 {
176
-
return405"API v1 is invalid. Either the image does not exist upstream, or you need auth to get a v2 endpoint working against $host";
187
+
return405"docker-registry-proxy: docker is trying to use v1 API. Either the image does not exist upstream, or you need to configure docker-registry-proxy to authenticate against $host";
177
188
}
178
189
179
-
# don't cache mutable entity /v2/<name>/manifests/<reference> (unless the reference is a digest)
0 commit comments