Compare commits
28 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 44d8ae2c5c | |||
| 1b1356cf36 | |||
| 24867b0fc9 | |||
| 57f5a4ebf9 | |||
| 44f73c026d | |||
| 2966cea94c | |||
| fef0d4f1fb | |||
| fe11917137 | |||
| fb286883d0 | |||
| 3ae6abf483 | |||
| ee271665d5 | |||
| c35f53315a | |||
| 1323c7dcd6 | |||
| 417e55ac8a | |||
| cd77dd9fa0 | |||
| 50aa924970 | |||
| b0c827a650 | |||
| 165d08fd15 | |||
| 0817135406 | |||
| f5f727b4f0 | |||
| 80d27d349e | |||
| 849fbd6e66 | |||
| 9fd45fea27 | |||
| 5fd31a685b | |||
| cc9e9857b1 | |||
| c4676b535b | |||
| 1de238172d | |||
| 02fea121cf |
4
dev.env
4
dev.env
@@ -5,5 +5,5 @@ NETWORK_NAME=proxy
|
||||
CERTBOT_CA_RESOLVER=https://acme-staging-v02.api.letsencrypt.org/directory
|
||||
DOMAIN=dev.kovagoadi.hu
|
||||
ACME_BYPASS=false
|
||||
TRAEFIK_LEGACY_OPT=
|
||||
# TRAEFIK_LEGACY_OPT="--providers.file.filename=/etc/traefik/forward-to-legacy-nginx.yaml"
|
||||
# TRAEFIK_LEGACY_OPT=
|
||||
TRAEFIK_LEGACY_OPT="--providers.file.directory=/etc/traefik"
|
||||
47
dev/forward-to-legacy-nginx.yaml
Normal file
47
dev/forward-to-legacy-nginx.yaml
Normal file
@@ -0,0 +1,47 @@
|
||||
# ./traefik/forward-to-legacy-nginx.yaml
|
||||
|
||||
tcp:
|
||||
routers:
|
||||
# Router for HTTPS (Passthrough)
|
||||
nginx-legacy-router-secure:
|
||||
rule: "HostSNI(`*`)"
|
||||
service: nginx-legacy-service-secure
|
||||
# Passthrough must be true for SSL to reach Nginx encrypted
|
||||
tls:
|
||||
passthrough: true
|
||||
priority: 10
|
||||
entryPoints:
|
||||
- "https"
|
||||
|
||||
services:
|
||||
# Service defining the external IP
|
||||
nginx-legacy-service-secure:
|
||||
loadBalancer:
|
||||
servers:
|
||||
# This is the actual external IP and Port of your Nginx
|
||||
- address: "webserver:443"
|
||||
|
||||
http:
|
||||
routers:
|
||||
# 1. TRAEFIK-MANAGED ACME HANDLER (Removed manual router)
|
||||
traefik-acme-handler:
|
||||
rule: "Host(`test-whoami.kovagoadi.hu`) && PathPrefix(`/.well-known/acme-challenge/`)"
|
||||
entryPoints:
|
||||
- "web"
|
||||
service: "acme-http@internal" # This is the internal service name
|
||||
priority: 1000 # High priority to ensure it wins
|
||||
|
||||
# 2. THE HTTP CATCH-ALL (Sends other ACME and HTTP to Nginx)
|
||||
nginx-legacy-router:
|
||||
rule: "HostRegexp(`^.+$`)"
|
||||
service: nginx-legacy-service
|
||||
# Low priority ensures specific containers are handled first, but before the default acme-handler
|
||||
priority: 90
|
||||
entryPoints:
|
||||
- "web"
|
||||
|
||||
services:
|
||||
nginx-legacy-service:
|
||||
loadBalancer:
|
||||
servers:
|
||||
- url: "http://webserver:80"
|
||||
30
dev/route-to-staging-dev.yaml
Normal file
30
dev/route-to-staging-dev.yaml
Normal file
@@ -0,0 +1,30 @@
|
||||
http:
|
||||
routers:
|
||||
# Router for HTTP (Port 80)
|
||||
staging:
|
||||
rule: "Host(`staging.kovagoadi.hu`) || Host(`test-whoami.staging.kovagoadi.hu`)"
|
||||
entryPoints:
|
||||
- "web"
|
||||
service: "dev-staging"
|
||||
priority: 1000000
|
||||
|
||||
# Router for HTTPS (Port 443)
|
||||
staging-secure:
|
||||
rule: "Host(`staging.kovagoadi.hu`) || Host(`dev.kovagoadi.hu`)"
|
||||
entryPoints:
|
||||
- "https"
|
||||
service: "dev-staging-secure"
|
||||
priority: 100
|
||||
tls: {} # <--- This enables TLS for this router
|
||||
|
||||
services:
|
||||
dev-staging:
|
||||
loadBalancer:
|
||||
servers:
|
||||
- url: "http://192.168.1.85:8080"
|
||||
|
||||
dev-staging-secure:
|
||||
loadBalancer:
|
||||
servers:
|
||||
# Note: Ensure Traefik trusts the cert at .85 or set insecureSkipVerify
|
||||
- url: "https://192.168.1.85:445"
|
||||
@@ -6,7 +6,9 @@ services:
|
||||
- no-new-privileges:true
|
||||
networks:
|
||||
- proxy
|
||||
- legacy-nginx
|
||||
command:
|
||||
- "--log.level=DEBUG"
|
||||
- "--providers.docker=true"
|
||||
- "--providers.docker.exposedbydefault=false"
|
||||
- "--providers.docker.network=proxy"
|
||||
@@ -28,7 +30,7 @@ services:
|
||||
volumes:
|
||||
- "/var/run/docker.sock:/var/run/docker.sock:ro"
|
||||
- "letsencrypt:/letsencrypt"
|
||||
- "./${ENV}/forward-to-legacy-nginx.yaml:/etc/traefik/forward-to-legacy-nginx.yaml"
|
||||
- "./${ENV}:/etc/traefik"
|
||||
|
||||
whoami:
|
||||
image: "traefik/whoami@sha256:200689790a0a0ea48ca45992e0450bc26ccab5307375b41c84dfc4f2475937ab"
|
||||
@@ -38,9 +40,9 @@ services:
|
||||
labels:
|
||||
- "env=${ENV}"
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.whoami.priority=100"
|
||||
- "traefik.http.routers.whoami.priority=1000000"
|
||||
- "traefik.http.routers.whoami.rule=Host(`test-whoami.${DOMAIN}`)"
|
||||
- "traefik.http.routers.https.priority=100"
|
||||
- "traefik.http.routers.https.priority=1000000"
|
||||
- "traefik.http.routers.https.rule=Host(`test-whoami.${DOMAIN}`)"
|
||||
- "traefik.http.routers.whoami.entrypoints=web"
|
||||
- traefik.http.routers.https.entrypoints=https
|
||||
@@ -48,5 +50,8 @@ services:
|
||||
- traefik.http.routers.https.tls.certresolver=letsencrypt
|
||||
networks:
|
||||
proxy:
|
||||
legacy-nginx:
|
||||
name: proxy
|
||||
external: true
|
||||
volumes:
|
||||
letsencrypt:
|
||||
2
prod.env
2
prod.env
@@ -5,4 +5,4 @@ NETWORK_NAME=proxy
|
||||
CERTBOT_CA_RESOLVER=https://acme-v02.api.letsencrypt.org/directory
|
||||
DOMAIN=kovagoadi.hu
|
||||
ACME_BYPASS=true
|
||||
TRAEFIK_LEGACY_OPT="--providers.file.filename=/etc/traefik/forward-to-legacy-nginx.yaml"
|
||||
TRAEFIK_LEGACY_OPT="--providers.file.directory=/etc/traefik"
|
||||
30
prod/route-to-staging-dev.yaml
Normal file
30
prod/route-to-staging-dev.yaml
Normal file
@@ -0,0 +1,30 @@
|
||||
http:
|
||||
routers:
|
||||
# Router for HTTP (Port 80)
|
||||
staging:
|
||||
rule: "HostRegexp({subdomain:.+}.staging.kovagoadi.hu`) || Host(`staging.kovagoadi.hu`) || Host(`dev.kovagoadi.hu`)"
|
||||
entryPoints:
|
||||
- "web"
|
||||
service: "dev-staging"
|
||||
priority: 1_000_000
|
||||
|
||||
# Router for HTTPS (Port 443)
|
||||
staging-secure:
|
||||
rule: "Host(`staging.kovagoadi.hu`) || Host(`dev.kovagoadi.hu`)"
|
||||
entryPoints:
|
||||
- "https"
|
||||
service: "dev-staging-secure"
|
||||
priority: 100
|
||||
tls: {} # <--- This enables TLS for this router
|
||||
|
||||
services:
|
||||
dev-staging:
|
||||
loadBalancer:
|
||||
servers:
|
||||
- url: "http://192.168.1.85:8080"
|
||||
|
||||
dev-staging-secure:
|
||||
loadBalancer:
|
||||
servers:
|
||||
# Note: Ensure Traefik trusts the cert at .85 or set insecureSkipVerify
|
||||
- url: "https://192.168.1.85:445"
|
||||
Reference in New Issue
Block a user