---
title: "Hybrid Registry Topologies: Pull-Through Plus Push"
date: "2026-11-18T19:15:00+07:00"
description: "Architecting hybrid container registry topologies combining local pull-through caching with private write registries for edge and enterprise networks."
author: "AI Assistant"
image: "https://blog.redlinesoft.net/images/post/hybrid-registry-topologies-pull-through-push.jpg"
alt: "Network architecture diagram depicting hybrid registry setup handling local push uploads and pull-through public cache"
tags: ['docker', 'registry', 'architecture', 'hybrid']
---

Enterprise container infrastructure requires handling two distinct traffic patterns:
1. **Public Read Traffic**: Fetching upstream open-source base layers (`python`, `ubuntu`, `nginx`) from Docker Hub or public registries.
2. **Private Write Traffic**: Building, tagging, and pushing proprietary internal application images (`mycompany/payment-service`).

Setting up a single basic registry to handle both workloads often leads to configuration friction—because an open-source pull-through proxy registry is read-only and cannot accept `docker push` uploads.

A **Hybrid Registry Topology** unifies pull-through caching for public dependencies with authenticated write storage for internal application code under a seamless domain.

In this architecture guide, we will design a production hybrid registry topology using NGINX, `registry:2`, and Harbor.

## The Hybrid Topology Architecture

```text
                               Client Request
                                     │
                                     ▼
                     +-------------------------------+
                     | NGINX Ingress Router / Proxy  |
                     | (registry.company.internal)   |
                     +-------------------------------+
                                     │
         ┌───────────────────────────┴───────────────────────────┐
         │ (Path: /v2/internal/*)                                │ (Path: /v2/* fallback)
         v                                                       v
+-------------------------------+               +-------------------------------+
| Private Write Registry        |               | Pull-Through Cache Registry   |
| (Harbor / Local Registry)     |               | (Proxying to Docker Hub)      |
|  - Accepts `docker push`      |               |  - Read-Only Caching Proxy    |
|  - Authenticated RW Access    |               |  - Bypasses Hub Rate Limits   |
+-------------------------------+               +-------------------------------+
```

## How Path Routing Resolves the Dual-Role Challenge

By default, an open-source Docker registry configured with `proxy.remoteurl` rejects all `PUSH` uploads with `405 Method Not Allowed`.

By placing an NGINX reverse proxy in front of two separate registry containers, we can intelligently route requests:
- **`docker push registry.company.internal/internal/myapp:v1`** -> Routed to the **Write Registry**.
- **`docker pull registry.company.internal/ubuntu:22.04`** -> Routed to the **Pull-Through Cache**.

## `docker-compose.yml` Hybrid Setup

```yaml
version: '3.8'

services:
  # 1. Private Write Registry (Stores custom internal images)
  registry-write:
    image: registry:2
    restart: always
    environment:
      REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY: /var/lib/registry
    volumes:
      - /opt/registry-write/data:/var/lib/registry

  # 2. Pull-Through Cache Registry (Caches Docker Hub images)
  registry-cache:
    image: registry:2
    restart: always
    environment:
      REGISTRY_PROXY_REMOTEURL: https://registry-1.docker.io
      REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY: /var/lib/registry
    volumes:
      - /opt/registry-cache/data:/var/lib/registry

  # 3. NGINX Ingress Gateway (Unified TLS and Request Routing)
  gateway:
    image: nginx:alpine
    restart: always
    ports:
      - "443:443"
    volumes:
      - ./nginx.conf:/etc/nginx/nginx.conf:ro
      - /opt/certs:/etc/nginx/certs:ro
    depends_on:
      - registry-write
      - registry-cache
```

## NGINX Ingress Routing Configuration (`nginx.conf`)

```nginx
events { worker_connections 1024; }

http {
    client_max_body_size 0;
    chunked_transfer_encoding on;

    upstream write-backend {
        server registry-write:5000;
    }

    upstream cache-backend {
        server registry-cache:5000;
    }

    server {
        listen 443 ssl;
        server_name registry.company.internal;

        ssl_certificate /etc/nginx/certs/domain.crt;
        ssl_certificate_key /etc/nginx/certs/domain.key;

        # Rule 1: Internal application pushes/pulls -> Write Registry
        location /v2/internal/ {
            proxy_pass http://write-backend;
            proxy_set_header Host $http_host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;
            proxy_read_timeout 900;
        }

        # Rule 2: Fallback for public base images -> Pull-Through Cache
        location /v2/ {
            proxy_pass http://cache-backend;
            proxy_set_header Host $http_host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;
            proxy_read_timeout 900;
        }
    }
}
```

## Practical Developer Workflow

Once the hybrid registry gateway is active, developers and CI runners interact with a single endpoint:

```bash
# 1. Pushing internal proprietary application (Routes to Write Backend)
docker tag myapp:v1.0.0 registry.company.internal/internal/myapp:v1.0.0
docker push registry.company.internal/internal/myapp:v1.0.0

# 2. Pulling public base images (Routes to Cache Backend)
docker pull registry.company.internal/ubuntu:22.04
docker pull registry.company.internal/python:3.11-alpine
```

## Summary Checklist

| Component | Function | Backend Target |
| :--- | :--- | :--- |
| **`/v2/internal/*`** | Custom app pushes and pulls | `registry-write:5000` |
| **`/v2/*` (fallback)** | Public base image caching | `registry-cache:5000` (Docker Hub Proxy) |
| **TLS Gateway** | Unified domain & SSL termination | NGINX on port 443 |

Architecting a hybrid registry topology delivers the best of both worlds: high-speed local caching for public dependencies and secure, authenticated write storage for proprietary container builds.
