Skip to content

Instantly share code, notes, and snippets.

@dawidof
Created November 16, 2025 16:07
Show Gist options
  • Select an option

  • Save dawidof/e75260e2830305a2f26307af2e080789 to your computer and use it in GitHub Desktop.

Select an option

Save dawidof/e75260e2830305a2f26307af2e080789 to your computer and use it in GitHub Desktop.
harbor and traefik
hostname: example-registry.com
external_url: https://example-registry.com
# http related config
http:
# port for http, default is 80. If https enabled, this port will redirect to https port
port: 8080
# https related config
# https:
# # https port for harbor, default is 443
# port: 8443
# internal_tls:
# enabled: false
# # The path of cert and key files for nginx
# #certificate: /your/certificate/path
# #private_key: /your/private/key/path
# # enable strong ssl ciphers (default: false)
# # strong_ssl_ciphers: false
version: "3.8"
services:
traefik:
image: traefik:v3.1
command:
- "--api.dashboard=true"
- "--providers.docker=true"
- "--providers.file.directory=/etc/traefik/dynamic"
- "--entrypoints.web.address=:80"
- "--entrypoints.websecure.address=:443"
- "--certificatesresolvers.le.acme.httpchallenge=true"
- "--certificatesresolvers.le.acme.httpchallenge.entrypoint=web"
- "[email protected]"
- "--certificatesresolvers.le.acme.storage=/acme.json"
ports:
- "80:80"
- "443:443"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- "./acme.json:/acme.json"
- "./dynamic:/etc/traefik/dynamic"
networks:
- traefik
- harbor
networks:
traefik:
harbor:
external: true
name: harbor_harbor
http:
routers:
harbor-router:
rule: "Host(`example-registry.com`)"
entryPoints: ["websecure"]
service: harbor-service
tls:
certResolver: le
middlewares:
- harbor-headers
middlewares:
harbor-headers:
headers:
customRequestHeaders:
Host: example-registry.com
X-Forwarded-Proto: https
services:
harbor-service:
loadBalancer:
servers:
- url: "http://nginx:8080" # Harbor internal HTTP
@dawidof
Copy link
Author

dawidof commented Nov 16, 2025

here is working example of harbor show only beginning of config file with traefik (I needed to have on one ip and vps many projects with https)

replace example-registry.com with your domain, also in filename -- should be /

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment