8.1: Why a Reverse Proxy? (Port 80 for everyone)

What is a reverse proxy?

A reverse proxy is an intermediary server that receives requests from clients (browsers, applications) and redirects them to the container or server that actually hosts your application.

In other words, your users never interact directly with your containers: they go through this central point.

Why is this useful?

  1. Centralized port management
    • Each container has its own internal port (e.g., Apache on 8080, Nginx on 8081, Nextcloud on 8082…).
    • Without a reverse proxy, your users would have to connect to these ports directly. That’s neither practical nor clean.
    • The reverse proxy receives all requests on port 80 (HTTP) or 443 (HTTPS) and routes them to the correct containers based on the domain name or subdomain.
  2. Simplified HTTPS
    • Traefik can automatically generate and renew SSL/TLS certificates via Let’s Encrypt.
    • Your containers remain on internal HTTP, but your users see a secure HTTPS site.
  3. Flexibility and Routing
    • You can host multiple sites on a single server using different containers.
    • Example:
      • site1.domain.tld β†’ PHP 7.4 + Apache container
      • site2.domain.tld β†’ WordPress container
      • api.domain.tld β†’ Node.js container
    • The Reverse Proxy handles all routing properly.
  4. Security and Isolation
    • Your containers are never directly exposed to the Internet.
    • You can add filtering rules, authentication, or even bandwidth limits directly in the proxy.

Simplified diagram

        Internet
           |
        [ Traefik ]
        |   |    |
     site1 site2  api
      (cont1) (cont2) (cont3)

Each container has its own internal port, but Traefik manages traffic on a single public port (80/443).

πŸ’‘ Tip: Even if you only have one site today, using a reverse proxy from the start prevents you from having to reorganize your containers later when you have multiple ones.