This repository was archived by the owner on Sep 12, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +58
-12
lines changed Expand file tree Collapse file tree 2 files changed +58
-12
lines changed Original file line number Diff line number Diff line change @@ -7,17 +7,27 @@ upstream docker-registry {
7
7
server localhost:5000;
8
8
}
9
9
10
+ # uncomment if you want a 301 redirect for users attempting to connect
11
+ # on port 80
12
+ # NOTE: docker client will still fail. This is just for convenience
13
+ # server {
14
+ # listen *:80;
15
+ # server_name my.docker.registry.com;
16
+ # return 301 https://$server_name$request_uri;
17
+ # }
18
+
10
19
server {
11
20
listen 443 ;
12
21
server_name my.docker.registry.com;
13
22
14
23
ssl on ;
15
24
ssl_certificate /etc/ssl/certs/docker-registry;
16
25
ssl_certificate_key /etc/ssl/private/docker-registry;
17
-
18
- proxy_set_header Host $http_host ; # required for docker client's sake
19
- proxy_set_header X-Real-IP $remote_addr ; # pass on real client's IP
20
-
26
+
27
+ proxy_set_header Host $http_host ; # required for docker client's sake
28
+ proxy_set_header X-Real-IP $remote_addr ; # pass on real client's IP
29
+ proxy_set_header Authorization "" ; # see https://github.com/dotcloud/docker-registry/issues/170
30
+
21
31
client_max_body_size 0 ; # disable any limits to avoid HTTP 413 for large image uploads
22
32
23
33
# required to avoid HTTP 411: see Issue #1486 (https://github.com/dotcloud/docker/issues/1486)
@@ -26,8 +36,21 @@ server {
26
36
location @my_411_error {
27
37
chunkin_resume;
28
38
}
29
-
39
+
30
40
location / {
31
- proxy_pass http://docker-registry;
41
+ proxy_pass http://docker-registry;
42
+ proxy_set_header Host $host ;
43
+ proxy_read_timeout 900 ;
44
+
45
+ auth_basic "Restricted" ;
46
+ auth_basic_user_file docker-registry.htpasswd;
47
+ }
48
+
49
+ location /_ping {
50
+ auth_basic off ;
51
+ }
52
+
53
+ location /v1/_ping {
54
+ auth_basic off ;
32
55
}
33
56
}
Original file line number Diff line number Diff line change @@ -5,23 +5,46 @@ upstream docker-registry {
5
5
server localhost:5000;
6
6
}
7
7
8
+ # uncomment if you want a 301 redirect for users attempting to connect
9
+ # on port 80
10
+ # NOTE: docker client will still fail. This is just for convenience
11
+ # server {
12
+ # listen *:80;
13
+ # server_name my.docker.registry.com;
14
+ # return 301 https://$server_name$request_uri;
15
+ # }
16
+
8
17
server {
9
18
listen 443;
10
19
server_name my.docker.registry.com;
11
20
12
21
ssl on;
13
22
ssl_certificate /etc/ssl/certs/docker-registry;
14
23
ssl_certificate_key /etc/ssl/private/docker-registry;
15
-
16
- proxy_set_header Host $http_host; # required for docker client's sake
17
- proxy_set_header X-Real-IP $remote_addr; # pass on real client's IP
18
-
24
+
25
+ proxy_set_header Host $http_host; # required for docker client's sake
26
+ proxy_set_header X-Real-IP $remote_addr; # pass on real client's IP
27
+ proxy_set_header Authorization ""; # see https://github.com/dotcloud/docker-registry/issues/170
28
+
19
29
client_max_body_size 0; # disable any limits to avoid HTTP 413 for large image uploads
20
30
21
31
# required to avoid HTTP 411: see Issue #1486 (https://github.com/dotcloud/docker/issues/1486)
22
32
chunked_transfer_encoding on;
23
-
33
+
24
34
location / {
25
- proxy_pass http://docker-registry;
35
+ proxy_pass http://docker-registry;
36
+ proxy_set_header Host $host;
37
+ proxy_read_timeout 900;
38
+
39
+ auth_basic "Restricted";
40
+ auth_basic_user_file docker-registry.htpasswd;
41
+ }
42
+
43
+ location /_ping {
44
+ auth_basic off;
45
+ }
46
+
47
+ location /v1/_ping {
48
+ auth_basic off;
26
49
}
27
50
}
You can’t perform that action at this time.
0 commit comments