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
Copy file name to clipboardExpand all lines: create_ca_cert.sh
+5-2Lines changed: 5 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -34,7 +34,7 @@ if [ -f "$CA_CRT_FILE" ] ; then
34
34
else
35
35
logInfo "No CA was found. Generating one."
36
36
logInfo "*** Please *** make sure to mount /ca as a volume -- if not, everytime this container starts, it will regenerate the CA and nothing will work."
# Just in case you want to rewrite some hosts. Default maps directly.
39
50
map$host$targetHost {
40
51
hostnames;
@@ -48,22 +59,27 @@ http {
48
59
include /etc/nginx/docker.auth.map;
49
60
default"";
50
61
}
51
-
62
+
63
+
# @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
+
52
73
# Map to decide which hosts get directed to the caching portion.
53
74
# This is automatically generated from the list of cached registries, plus a few fixed hosts
54
75
# By default, we don't intercept, allowing free flow of non-registry traffic
55
76
map$connect_host$interceptedHost {
56
77
hostnames;
57
78
include /etc/nginx/docker.intercept.map;
58
-
default"$connect_host:443";
59
-
}
60
-
61
-
map$dockerAuth$finalAuth {
62
-
"""$http_authorization"; # if empty, keep the original passed-in from the client
63
-
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.'
64
80
}
65
-
66
-
81
+
82
+
67
83
# These maps parse the original Host and URI from a /forcecache redirect.
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";
184
188
}
185
189
186
-
# don't cache mutable entity /v2/_catalog
187
-
location ~ ^/v2/_catalog$ {
188
-
proxy_pass https://$targetHost;
189
-
}
190
-
191
-
# force cache of the first hit which is always /v2/ - even for 401 unauthorized.
192
-
location= /v2/ {
193
-
proxy_pass https://$targetHost;
194
-
proxy_cache cache;
195
-
proxy_cache_valid20030130230740160d;
196
-
}
197
190
198
-
# cache everything else
199
-
location/ {
191
+
# for the /v2/..../blobs/.... URIs, do cache, and treat redirects.
0 commit comments