# Help setting up the HTTP Connector for Docker Proxy

**URL:** <https://community.sonatype.com/t/help-setting-up-the-http-connector-for-docker-proxy/12714>\
**Category:** Sonatype Nexus Repository\
**Tags:** docker\
**Created:** [June 13, 2024, 10:44am UTC](https://community.sonatype.com/t/help-setting-up-the-http-connector-for-docker-proxy/12714 "2024-06-13T10:44:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dxkpine](https://avatars.discourse-cdn.com/v4/letter/d/4491bb/32.png) [@dxkpine](https://community.sonatype.com/u/dxkpine)\
**Post date:** [June 13, 2024, 10:44am UTC](https://community.sonatype.com/t/help-setting-up-the-http-connector-for-docker-proxy/12714/1 "2024-06-13T10:44:56Z")

</div>

I deployed nexus3(3.69.0-02) container by docker image (sonatype/nexus3), then I set up a docker proxy repository.  
I referred to some online tutorials about reverse-proxy setting by nginx, the nginx server config is :

```auto
server {
  listen 80;
  server_name local.nexus.com;

  location / {
          proxy_pass http://{my_nexus3_container}:8081/repository/{my_docker_proxy_repository}/$request_uri;
          proxy_set_header Host $host;
          proxy_http_version 1.1;
          proxy_set_header X-Forwarded-For $remote_addr;
          proxy_set_header X-Forwarded-Proto $scheme;
          proxy_connect_timeout 60s;
          proxy_send_timeout 60s;
          proxy_read_timeout 300s;
          send_timeout 60s;
          proxy_buffers 16 32k;
          proxy_buffer_size 64k;
          proxy_set_header Connection "";
   }
}

```

and my docker daemon.json setting is :

```auto
{
    "registry-mirrors":[
        "http://local.nexus.com:80"
    ],
    "insecure-registries":[
        "local.nexus.com:80"
    ]

```

The `local.nexus.com` has pointed to 127.0.0.1.

Then I try to run this command and I found it is work !

```auto
docker pull local.nexus.com/busybox

```

(At the same time, I also found that command `docker pull busybox` not work, I try to analysis it by `tcpdump` and I found it try to pull form “[registry-1.docker.io](http://registry-1.docker.io)”, not my proxy setting. I don’t known why, but it isn’t main question in this asking.)

**The Main Question Start From Here:**

The reverse proxy of nginx is not a direct access, so I try the “Repository Connectors” which the setting in docker proxy repository.  
I set my docker proxy repository http connectors is 8083, and expose the 8083 port of the container, and then change the daemon.json to :

```auto
{
    "registry-mirrors":[
        "http://local.nexus.com:8083"
    ],
    "insecure-registries":[
        "local.nexus.com:8083"
    ]

```

I try to run `docker pull local.nexus.com:8083/busybox` , **but it doesn’t work!**

It printed some html code, and the main of conent maybe is :

```auto
<div class="nexus-body">
  <div class="content-header">
    <img src="../../../../../static/rapture/resources/icons/x32/exclamation.png?3.69.0-02" alt="Exclamation point" aria-role="presentation"/>
    <span class="title">Error 404</span>
    <span class="description">Not Found</span>
  </div>
  <div class="content-body">
    <div class="content-section">
      Not Found
    </div>
  </div>
</div>

```

Error 404? I try to find the reason then I think it may be cause by not found the repository. The helper document in [here](https://help.sonatype.com/en/docker-registry.html?&_ga=2.96809887.1872459690.1718095134-95784031.1718095134#docker-port-scalability) seem to talk about that, the third method “Using port connectors” is my want to do, but is just talk about the ssl and https not http.

So, how can I use the docker proxy repository by HTTP Connector? What are the right setps?

---

<div class="post-metadata">

**Author:** ![slv\_b](https://avatars.discourse-cdn.com/v4/letter/s/eada6e/32.png) [@slv\_b](https://community.sonatype.com/u/slv_b)\
**Post date:** [June 13, 2024, 7:29pm UTC](https://community.sonatype.com/t/help-setting-up-the-http-connector-for-docker-proxy/12714/2 "2024-06-13T19:29:12Z")

</div>

Read this article  
[https://help.sonatype.com/en/docker-repository-reverse-proxy-strategies.html](https://help.sonatype.com/en/docker-repository-reverse-proxy-strategies.html)  
May it`s help to you.  
main steps

1. make docker group repo  
1.1 put your proxy docker repo in group
2. location in nginx config is “/v1” and “v2”  
and points to your group docker repo

---

<div class="post-metadata">

**Author:** ![dxkpine](https://avatars.discourse-cdn.com/v4/letter/d/4491bb/32.png) [@dxkpine](https://community.sonatype.com/u/dxkpine)\
**Post date:** [June 14, 2024, 1:28am UTC](https://community.sonatype.com/t/help-setting-up-the-http-connector-for-docker-proxy/12714/3 "2024-06-14T01:28:59Z")

</div>

I knwo the group docker, however, proxy docker has HTTP Connector setting, is there a right way to use it?

---

<div class="post-metadata">

**Author:** ![dxkpine](https://avatars.discourse-cdn.com/v4/letter/d/4491bb/32.png) [@dxkpine](https://community.sonatype.com/u/dxkpine)\
**Post date:** [June 14, 2024, 1:34am UTC](https://community.sonatype.com/t/help-setting-up-the-http-connector-for-docker-proxy/12714/4 "2024-06-14T01:34:47Z")

</div>

And you should know, the nginx config doesn’t must be configed the “/v1” and “v2”. The important point is the `proxy_pass` url is 8081 port (nexus default port) and the path of uri is the right way to the repo( proxy repo or group repo are OK)
