docker login返回404 for artifactory

我在artfactory中为docker存储库配置了以下nginx

server {
    listen 2222 ssl;

    server_name rproxy.company.com;
    if ($http_x_forwarded_proto = '') {
        set $http_x_forwarded_proto  $scheme;
    }

    rewrite ^/(v1|v2)/(.*) /artifactory/api/docker/docker-dev/$1/$2;
    client_max_body_size 0;
    chunked_transfer_encoding on;

    location / {
    allow all;
    proxy_read_timeout  900;
    proxy_pass_header   Server;
    proxy_cookie_path ~*^/.* /;
    proxy_set_header   X-Artifactory-Override-Base-Url $http_x_forwarded_proto://$host:$server_port;
    proxy_set_header    X-Forwarded-Port  $server_port;
    proxy_set_header    X-Forwarded-Proto $http_x_forwarded_proto;
    proxy_set_header    Host              $http_host;
    proxy_set_header    X-Forwarded-For   $proxy_add_x_forwarded_for;
    proxy_pass http://artifactory_lb;
    }

但是docker登录 rproxy.compan.com:2222 会返回404

这是此请求的访问日志

“GET /api/docker/docker-dev/v2/token?account=myUsre&client_id=docker&offline_token=true&service=rproxy.company.com%3A2222 HTTP / 1.1”404 473“ - ”“docker / 1.11.0 go / go1 . 5.4 git-commit / 4dc5990 kernel / 3.13.0-24-generic os / linux arch / amd64 UpstreamClient(Docker-Client / 1.11.0 \ x5C(linux \ x5C))“

命令 curl -umyUser:myPass "https://rproxy.company.com:2222/v2/auth" 返回正确的身份验证令牌

我也使用Docker版本1.11和Artifactory版本4.60 . 任何指向我可能缺少的东西?

是否还需要从docker reositories的Web界面配置反向代理?

回答(1)

2 years ago

我得到了同样的错误,因为在生成Nginx配置之前,我忘了填写Docker存储库的高级设置 .

重新生成配置并重新启动解决了它 .