github.com/samsalisbury/distribution@v2.2.1-0.20151123021722-54f974340220+incompatible/contrib/compose/nginx/registry.conf (about) 1 # Docker registry proxy for api versions 1 and 2 2 3 upstream docker-registry { 4 server registryv1:5000; 5 } 6 7 upstream docker-registry-v2 { 8 server registryv2:5000; 9 } 10 11 # No client auth or TLS 12 server { 13 listen 5000; 14 server_name localhost; 15 16 # disable any limits to avoid HTTP 413 for large image uploads 17 client_max_body_size 0; 18 19 # required to avoid HTTP 411: see Issue #1486 (https://github.com/docker/docker/issues/1486) 20 chunked_transfer_encoding on; 21 22 location /v2/ { 23 # Do not allow connections from docker 1.5 and earlier 24 # docker pre-1.6.0 did not properly set the user agent on ping, catch "Go *" user agents 25 if ($http_user_agent ~ "^(docker\/1\.(3|4|5(?!\.[0-9]-dev))|Go ).*$" ) { 26 return 404; 27 } 28 29 # To add basic authentication to v2 use auth_basic setting plus add_header 30 # auth_basic "registry.localhost"; 31 # auth_basic_user_file test.password; 32 # add_header 'Docker-Distribution-Api-Version' 'registry/2.0' always; 33 34 include docker-registry-v2.conf; 35 } 36 37 location / { 38 include docker-registry.conf; 39 } 40 } 41