Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ----
- so you're going to need to also add a new volume for special directives for old clients. you need to follow these instructions, and then start a new nginx-proxy container with a new volume:
- -v /var/docker/nginx-proxy/vhost.d:/etc/nginx/vhost.d:ro
- but first you need to do this:
- sudo mkdir -p /var/docker/nginx-proxy/vhost.d && cd /var/docker/nginx-proxy
- sudo vim vhost.d/myregistry.example.com
- add the following:
- ----
- client_max_body_size 0;
- chunked_transfer_encoding on;
- location /v2/ {
- # Do not allow connections from docker 1.5 and earlier
- # docker pre-1.6.0 did not properly set the user agent on ping, catch "Go *" user agents
- if ($http_user_agent ~ "^(docker\/1\.(3|4|5(?!\.[0-9]-dev))|Go ).*$" ) {
- return 404;
- }
- add_header Docker-Distribution-Api-Version "registry/2.0";
- #more_set_headers 'Content-Type: application/json; charset=utf-8';
- include vhost.d/docker-registry.conf;
- }
- location /v1/_ping {
- auth_basic off;
- include vhost.d/docker-registry.conf;
- add_header X-Ping "inside /v1/_ping";
- add_header X-Ping "INSIDE /v1/_ping";
- }
- location /v1/users {
- auth_basic off;
- include vhost.d/docker-registry.conf;
- add_header X-Users "inside /v1/users";
- add_header X-Users "INSIDE /v1/users";
- }
- =================== THEN create a file: sudo vim /var/docker/nginx-proxy/vhost.d/docker-registry.conf
- proxy_pass http://myregistry.mexample.com;
- proxy_set_header Host $http_host; # required for docker client's sake
- proxy_set_header X-Real-IP $remote_addr; # pass on real client's IP
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header X-Forwarded-Proto $scheme;
- proxy_read_timeout 900;
Advertisement
Add Comment
Please, Sign In to add comment