Nexus3 Private docker registry, authenticated required after successful login


I used my auth required private docker registry as docker registry mirrors ,But get an auth error (I have login success with my private registry ).

All my step is below:

1. Success to login my nexus3 private docker registry

1) When I docker pull without login ,the docker
need me to login(myPrivateDocker is created by me ).

2) And then I login success to my nexus3 private docker registry
pic of login success

3) I use docker pull success now.

2. When I add register mirrors to docker ,but failed to auth

1). Because every time to pull with is not good.So I set docker Registry Mirrors to /etc/docker/daemon with

"registry-mirrors": [""],

and then restart my daemon and docker . when use docker info ,I can see my registry-mirrors was correct.

Success docker info with registry-mirrors

2) But when I want to use docker pull myPrivateDocker:latest with error below:

$ docker pull myPrivateDocker:latest

Error response from daemon: Get unauthorized: incorrect username or password

I login my private registry success now .this error puzzled me long time.And I go to see my nginx logs ,and get an error with auth.Nginx logs can specific that my pull request is request to my mirror setting now is efficiently.

But nginx error with auth :

"GET /v2/token?scope=repository%3Alibrary%2Fnexus%3Apull& HTTP/1.1" 200 60 "-" "docker/18.09.2 go/go1.10.6 git-commit/6247962 kernel/4.9.125-linuxkit os/linux arch/amd64 UpstreamClient(Docker-Client/18.09.2 x5C(darwinx5C))" - - [09/Jun/2019:14:08:15 +0800] 

"GET /v2/library/nexus/manifests/3.16.2-3 HTTP/1.1" 401 113 "-" "docker/18.09.2 go/go1.10.6 git-commit/6247962 kernel/4.9.125-linuxkit os/linux arch/amd64 UpstreamClient(Docker-Client/18.09.2 x5C(darwinx5C))"

Then I found there’s no account name in my request url . I ever use public docker mirror with no auth and can use very well.But never use a private docker registry mirror , What can I do to this? I don’t want to use a very long name to pull my images such as docker pull

My nginx config :

  listen 443;

  client_max_body_size 1G;
  proxy_buffering    off;
  keepalive_timeout  5 5;
  tcp_nodelay        on;

  ssl on;
  ssl_certificate /root/ssl_ca/;xx
  ssl_certificate_key /root/ssl_ca/;
  ssl_session_timeout 5m;
  ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  ssl_prefer_server_ciphers on;

  location / {
        proxy_headers_hash_max_size 51200;
        proxy_headers_hash_bucket_size 6400;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header X-Forwarded-Proto https;
        proxy_set_header Host $host;
        proxy_pass http://localhost:7719;

 location /v1/search {
    auth_basic off;
    proxy_pass http://localhost:7719;

Source: StackOverflow