Uploaded image for project: 'Artifactory Binary Repository'
  1. Artifactory Binary Repository
  2. RTFACT-16034

Cannot push to Docker registry with Nginx reverse proxy

    Details

    • Type: Bug
    • Status: Will Not Implement
    • Priority: Normal
    • Resolution: Unresolved
    • Affects Version/s: 5.5.2
    • Fix Version/s: None
    • Component/s: Docker
    • Environment:

      Artifactory Docker container: docker.bintray.io/jfrog/artifactory-pro:5.5.2
      Reverse proxy with nginx Docker container: nginx:1.13.5

      Description

      We are not able to push anything to the Docker registry of Artifactory. No problem to login, or pull Docker images, but whenever we try to push an image, it keeps returning: unknown Not Found.

      ###########################################################
      ## this configuration was generated by JFrog Artifactory ##
      ###########################################################
      
      ## server configuration
      server {
          ssl_certificate             /secret/cert.cer;
          ssl_certificate_key         /secret/cert.key;
          ssl_session_cache shared:SSL:1m;
          ssl_prefer_server_ciphers   on;
          listen 443 ssl;
          listen 80 ;
          server_name servername;
          
          if ($http_x_forwarded_proto = '') {
              set $http_x_forwarded_proto  $scheme;
          }
          ## Application specific logs
          ## access_log /var/log/nginx/servername-access.log timing;
          ## error_log /var/log/nginx/servername.com-error.log;
          rewrite ^/$ /webapp/ redirect;
          rewrite ^//?(/webapp)?$ /webapp/ redirect;
          chunked_transfer_encoding on;
          client_max_body_size 0;
          location / {
          proxy_read_timeout  900;
          proxy_pass_header   Server;
          proxy_cookie_path   ~*^/.* /;
          if ( $request_uri ~ ^/(.*)$ ) {
              proxy_pass          http://artifactory:8081/artifactory/$1;
          }
          proxy_pass          http://artifactory:8081/artifactory/;
          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;
          }
      }
      
      ## server configuration
      server {
          ssl_certificate             /secret/cert2.crt;
          ssl_certificate_key         /secret/cert2.key;
          ssl_session_cache shared:SSL:1m;
          ssl_prefer_server_ciphers   on;
          listen 443 ssl;
          listen 80 ;
          server_name ~(?<repo>.+)\.servername;
          
          if ($http_x_forwarded_proto = '') {
              set $http_x_forwarded_proto  $scheme;
          }
          ## Application specific logs
          ## access_log /var/log/nginx/servername-access.log timing;
          ## error_log /var/log/nginx/servername-error.log;
          rewrite ^/$ /webapp/ redirect;
          rewrite ^//?(/webapp)?$ /webapp/ redirect;
          rewrite ^/(v1|v2)/(.*) /api/docker/$repo/$1/$2;
          chunked_transfer_encoding on;
          client_max_body_size 0;
          location / {
          proxy_read_timeout  900;
          proxy_pass_header   Server;
          proxy_cookie_path   ~*^/.* /;
          if ( $request_uri ~ ^/(.*)$ ) {
              proxy_pass          http://artifactory:8081/artifactory/$1;
          }
          proxy_pass          http://artifactory:8081/artifactory/;
          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;
          }
      }
      
      $ docker --version
      Docker version 17.12.0-ce, build c97c6d6
      
      $ docker tag jenkins/jenkins:latest dev-docker.servername/jenkins:latest
      $ docker push dev-docker.servername/jenkins.latest
      unknown: Not Found
      

      Nginx log

      192.168.0.1 - - [06/Mar/2018:09:28:38 +0000] "GET /v2/ HTTP/1.1" 404 74 "-" "docker/17.12.0-ce go/go1.9.2 git-commit/c97c6d6 kernel/4.4.0-62-generic os/linux arch/amd64 UpstreamClient(Docker-Client/17.12.0-ce \x5C(linux\x5C))" "-"
      192.168.0.1 - - [06/Mar/2018:09:28:38 +0000] "HEAD /v2/jenkins/blobs/sha256:8a9a7ee1d4e5a30168a9a81a2c844d2269363467561c04236b7fe348ce42068c HTTP/1.1" 404 0 "-" "docker/17.12.0-ce go/go1.9.2 git-commit/c97c6d6 kernel/4.4.0-62-generic os/linux arch/amd64 UpstreamClient(Docker-Client/17.12.0-ce \x5C(linux\x5C))" "-"
      192.168.0.1 - - [06/Mar/2018:09:28:38 +0000] "HEAD /v2/jenkins/blobs/sha256:680b417a6a8a0857577b18265705c4eefb4cb69544e53926e29bf6ff4d817847 HTTP/1.1" 404 0 "-" "docker/17.12.0-ce go/go1.9.2 git-commit/c97c6d6 kernel/4.4.0-62-generic os/linux arch/amd64 UpstreamClient(Docker-Client/17.12.0-ce \x5C(linux\x5C))" "-"
      192.168.0.1 - - [06/Mar/2018:09:28:38 +0000] "HEAD /v2/jenkins/blobs/sha256:b11639fe4d6def7ad2875776b11fc990184bcd7dbb8ab987d47d8729fae463b5 HTTP/1.1" 404 0 "-" "docker/17.12.0-ce go/go1.9.2 git-commit/c97c6d6 kernel/4.4.0-62-generic os/linux arch/amd64 UpstreamClient(Docker-Client/17.12.0-ce \x5C(linux\x5C))" "-"
      192.168.0.1 - - [06/Mar/2018:09:28:38 +0000] "HEAD /v2/jenkins/blobs/sha256:560b248e7e4a68c83e8b026210ea8fde2f14d334a66e0960084325cd85c55fbb HTTP/1.1" 404 0 "-" "docker/17.12.0-ce go/go1.9.2 git-commit/c97c6d6 kernel/4.4.0-62-generic os/linux arch/amd64 UpstreamClient(Docker-Client/17.12.0-ce \x5C(linux\x5C))" "-"
      192.168.0.1 - - [06/Mar/2018:09:28:38 +0000] "HEAD /v2/jenkins/blobs/sha256:76b866095c1bd148cfc3227fa84321f1b07c1f3a06b3d6f43d3b855755145d91 HTTP/1.1" 404 0 "-" "docker/17.12.0-ce go/go1.9.2 git-commit/c97c6d6 kernel/4.4.0-62-generic os/linux arch/amd64 UpstreamClient(Docker-Client/17.12.0-ce \x5C(linux\x5C))" "-"
      192.168.0.1 - - [06/Mar/2018:09:28:38 +0000] "POST /v2/jenkins/blobs/uploads/ HTTP/1.1" 404 74 "-" "docker/17.12.0-ce go/go1.9.2 git-commit/c97c6d6 kernel/4.4.0-62-generic os/linux arch/amd64 UpstreamClient(Docker-Client/17.12.0-ce \x5C(linux\x5C))" "-"
      192.168.0.1 - - [06/Mar/2018:09:28:38 +0000] "POST /v2/jenkins/blobs/uploads/ HTTP/1.1" 404 74 "-" "docker/17.12.0-ce go/go1.9.2 git-commit/c97c6d6 kernel/4.4.0-62-generic os/linux arch/amd64 UpstreamClient(Docker-Client/17.12.0-ce \x5C(linux\x5C))" "-"
      192.168.0.1 - - [06/Mar/2018:09:28:38 +0000] "POST /v2/jenkins/blobs/uploads/ HTTP/1.1" 404 74 "-" "docker/17.12.0-ce go/go1.9.2 git-commit/c97c6d6 kernel/4.4.0-62-generic os/linux arch/amd64 UpstreamClient(Docker-Client/17.12.0-ce \x5C(linux\x5C))" "-"
      192.168.0.1 - - [06/Mar/2018:09:28:38 +0000] "POST /v2/jenkins/blobs/uploads/ HTTP/1.1" 404 74 "-" "docker/17.12.0-ce go/go1.9.2 git-commit/c97c6d6 kernel/4.4.0-62-generic os/linux arch/amd64 UpstreamClient(Docker-Client/17.12.0-ce \x5C(linux\x5C))" "-"
      192.168.0.1 - - [06/Mar/2018:09:28:38 +0000] "POST /v2/jenkins/blobs/uploads/ HTTP/1.1" 404 74 "-" "docker/17.12.0-ce go/go1.9.2 git-commit/c97c6d6 kernel/4.4.0-62-generic os/linux arch/amd64 UpstreamClient(Docker-Client/17.12.0-ce \x5C(linux\x5C))" "-"
      192.168.0.1 - - [06/Mar/2018:09:28:43 +0000] "POST /v2/jenkins/blobs/uploads/ HTTP/1.1" 404 74 "-" "docker/17.12.0-ce go/go1.9.2 git-commit/c97c6d6 kernel/4.4.0-62-generic os/linux arch/amd64 UpstreamClient(Docker-Client/17.12.0-ce \x5C(linux\x5C))" "-"
      192.168.0.1 - - [06/Mar/2018:09:28:43 +0000] "POST /v2/jenkins/blobs/uploads/ HTTP/1.1" 404 74 "-" "docker/17.12.0-ce go/go1.9.2 git-commit/c97c6d6 kernel/4.4.0-62-generic os/linux arch/amd64 UpstreamClient(Docker-Client/17.12.0-ce \x5C(linux\x5C))" "-"
      192.168.0.1 - - [06/Mar/2018:09:28:43 +0000] "POST /v2/jenkins/blobs/uploads/ HTTP/1.1" 404 74 "-" "docker/17.12.0-ce go/go1.9.2 git-commit/c97c6d6 kernel/4.4.0-62-generic os/linux arch/amd64 UpstreamClient(Docker-Client/17.12.0-ce \x5C(linux\x5C))" "-"
      192.168.0.1 - - [06/Mar/2018:09:28:43 +0000] "POST /v2/jenkins/blobs/uploads/ HTTP/1.1" 404 74 "-" "docker/17.12.0-ce go/go1.9.2 git-commit/c97c6d6 kernel/4.4.0-62-generic os/linux arch/amd64 UpstreamClient(Docker-Client/17.12.0-ce \x5C(linux\x5C))" "-"
      192.168.0.1 - - [06/Mar/2018:09:28:43 +0000] "POST /v2/jenkins/blobs/uploads/ HTTP/1.1" 404 74 "-" "docker/17.12.0-ce go/go1.9.2 git-commit/c97c6d6 kernel/4.4.0-62-generic os/linux arch/amd64 UpstreamClient(Docker-Client/17.12.0-ce \x5C(linux\x5C))" "-"
      

      Artifactory log

      2018-03-06 09:28:38,206 [http-nio-8081-exec-9] [WARN ] (o.a.w.s.RequestUtils:155) - Request /v2/ should be a repo request and does not match any repo key
      2018-03-06 09:28:38,218 [http-nio-8081-exec-6] [WARN ] (o.a.w.s.RequestUtils:155) - Request /v2/jenkins/blobs/sha256:8a9a7ee1d4e5a30168a9a81a2c844d2269363467561c04236b7fe348ce42068c should be a repo request and does not match any repo key
      2018-03-06 09:28:38,218 [http-nio-8081-exec-7] [WARN ] (o.a.w.s.RequestUtils:155) - Request /v2/jenkins/blobs/sha256:b11639fe4d6def7ad2875776b11fc990184bcd7dbb8ab987d47d8729fae463b5 should be a repo request and does not match any repo key
      2018-03-06 09:28:38,218 [http-nio-8081-exec-3] [WARN ] (o.a.w.s.RequestUtils:155) - Request /v2/jenkins/blobs/sha256:560b248e7e4a68c83e8b026210ea8fde2f14d334a66e0960084325cd85c55fbb should be a repo request and does not match any repo key
      2018-03-06 09:28:38,218 [http-nio-8081-exec-4] [WARN ] (o.a.w.s.RequestUtils:155) - Request /v2/jenkins/blobs/sha256:680b417a6a8a0857577b18265705c4eefb4cb69544e53926e29bf6ff4d817847 should be a repo request and does not match any repo key
      2018-03-06 09:28:38,220 [http-nio-8081-exec-8] [WARN ] (o.a.w.s.RequestUtils:155) - Request /v2/jenkins/blobs/sha256:76b866095c1bd148cfc3227fa84321f1b07c1f3a06b3d6f43d3b855755145d91 should be a repo request and does not match any repo key
      2018-03-06 09:28:38,226 [http-nio-8081-exec-2] [WARN ] (o.a.w.s.RequestUtils:155) - Request /v2/jenkins/blobs/uploads/ should be a repo request and does not match any repo key
      2018-03-06 09:28:38,227 [http-nio-8081-exec-10] [WARN ] (o.a.w.s.RequestUtils:155) - Request /v2/jenkins/blobs/uploads/ should be a repo request and does not match any repo key
      2018-03-06 09:28:38,227 [http-nio-8081-exec-5] [WARN ] (o.a.w.s.RequestUtils:155) - Request /v2/jenkins/blobs/uploads/ should be a repo request and does not match any repo key
      2018-03-06 09:28:38,228 [http-nio-8081-exec-9] [WARN ] (o.a.w.s.RequestUtils:155) - Request /v2/jenkins/blobs/uploads/ should be a repo request and does not match any repo key
      2018-03-06 09:28:38,228 [http-nio-8081-exec-1] [WARN ] (o.a.w.s.RequestUtils:155) - Request /v2/jenkins/blobs/uploads/ should be a repo request and does not match any repo key
      2018-03-06 09:28:43,236 [http-nio-8081-exec-6] [WARN ] (o.a.w.s.RequestUtils:155) - Request /v2/jenkins/blobs/uploads/ should be a repo request and does not match any repo key
      2018-03-06 09:28:43,236 [http-nio-8081-exec-7] [WARN ] (o.a.w.s.RequestUtils:155) - Request /v2/jenkins/blobs/uploads/ should be a repo request and does not match any repo key
      2018-03-06 09:28:43,236 [http-nio-8081-exec-4] [WARN ] (o.a.w.s.RequestUtils:155) - Request /v2/jenkins/blobs/uploads/ should be a repo request and does not match any repo key
      2018-03-06 09:28:43,238 [http-nio-8081-exec-3] [WARN ] (o.a.w.s.RequestUtils:155) - Request /v2/jenkins/blobs/uploads/ should be a repo request and does not match any repo key
      2018-03-06 09:28:43,239 [http-nio-8081-exec-8] [WARN ] (o.a.w.s.RequestUtils:155) - Request /v2/jenkins/blobs/uploads/ should be a repo request and does not match any repo key
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              sander.bel Sander Bel
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: