title: Nexus 3 as Docker Registry behind Traefik v.2 - pushing fails
body: <p>On the same linux VM with docker v.19.03.11 I'm running:</p>
  <p>Nexus:</p>
  <pre><code>version: '3.7'
  
  services:
    nexus:
      container_name: nexus
      image: sonatype/nexus3
      volumes:
        - nexus-data:/nexus-data
      networks:
        - web
      ports:
        - 8081
        - 8082
        - 8083
      restart: always
      labels:
        - &quot;traefik.enable=true&quot;
        - &quot;traefik.docker.network=web&quot;
        # admin.nexus.xxx.intern
        - &quot;traefik.http.routers.nexus.rule=Host(`admin.nexus.xxx.intern`, `maven.nexus.itools.intern`)&quot;
        - &quot;traefik.http.services.nexus.loadbalancer.server.port=8081&quot;
        - &quot;traefik.http.routers.nexus.service=nexus&quot;
        - &quot;traefik.http.routers.nexus.entrypoints=web&quot;
        # docker.nexus.xxx.intern
        - &quot;traefik.http.routers.docker.rule=Host(`docker.nexus.xxx.intern`)&quot;
        - &quot;traefik.http.services.docker.loadbalancer.server.port=8083&quot;
        - &quot;traefik.http.routers.docker.service=docker&quot;
        - &quot;traefik.http.routers.docker.entrypoints=web&quot;
  
  networks:
    web:
      external: true
  volumes:
    nexus-data:
      external: true
  </code></pre>
  <p>in Nexus Repository Manager Dashboard I created one hosted docker repository and assigned it port 8083.</p>
  <p>and Traefik:</p>
  <pre><code>version: '3.7'
  
  services:
    traefik:
      container_name: traefik
      image: traefik
      volumes:
        - /var/run/docker.sock:/var/run/docker.sock
        - ./conf:/conf
        - ../ssl:/ssl:ro
      networks:
        - web
      ports:
        - 80:80
        - 443:443
      restart: always
      command:
        # Enabling docker provider
        - &quot;--providers.docker=true&quot;
        # Do not expose containers unless explicitly told so
        - &quot;--providers.docker.exposedbydefault=false&quot;
        # Enable API (listening on port 8080)
        - &quot;--api.insecure=true&quot;
        - &quot;--entrypoints.web.address=:80&quot;
        - &quot;--entrypoints.websecure.address=:443&quot;
        # Enable the file provider to define routers / middlewares / services in file
        # EMPTY AT THE TIME!
        - &quot;--providers.file.directory=/conf&quot;
      labels:
        - &quot;traefik.enable=true&quot;
        - &quot;traefik.http.routers.traefik.service=api@internal&quot;
        - &quot;traefik.http.routers.traefik.rule=Host(`traefik.xxx.intern`)&quot;
        - &quot;traefik.http.routers.traefik.entrypoints=web&quot;
        - &quot;traefik.http.routers.traefik_tls.tls=true&quot;
        - &quot;traefik.http.routers.traefik_tls.rule=Host(`traefik.xxx.intern`)&quot;
        - &quot;traefik.http.routers.traefik_tls.entrypoints=websecure&quot;
        - &quot;traefik.http.routers.traefik_tls.service=api@internal&quot;
  networks:
    web:
      external: true
  </code></pre>
  <p>I can login into the docker repository form anywhere:</p>
  <pre><code>docker login -u user -p password1234 docker.nexus.xxx.intern
  WARNING! Using --password via the CLI is insecure. Use --password-stdin.
  Login Succeeded
  </code></pre>
  <p>but I cannot push into the registry:</p>
  <pre><code>docker push docker.nexus.xxx.intern/hello-world
  The push refers to repository [docker.nexus.xxx.intern/hello-world]
  af0b15c8625b: Preparing
  error parsing HTTP 404 response body: invalid character 'p' after top-level value: &quot;404 page not found\n&quot;
  </code></pre>
  <p>When I expose the port 8083 and bypass Traefik, everything works fine and I can push into the Nexus Registry. The problem is I can only expose ports 80 and 443.</p>
  <p>Did anyone have a similar issue and knows how to solve it?</p>
  <p>Update 1</p>
  <p>Have also tried with Harbor - the same result - cannot push behind traefik.</p>