diff --git a/preprod/forward-to-legacy-nginx.yaml b/preprod/forward-to-legacy-nginx.yaml new file mode 100644 index 0000000..4da1e72 --- /dev/null +++ b/preprod/forward-to-legacy-nginx.yaml @@ -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" \ No newline at end of file diff --git a/preprod/route-to-staging-dev.yaml b/preprod/route-to-staging-dev.yaml new file mode 100644 index 0000000..fd12671 --- /dev/null +++ b/preprod/route-to-staging-dev.yaml @@ -0,0 +1,33 @@ +http: + routers: + # Router for HTTP (Port 80) + staging: + rule: "HostRegexp(`^.+\\.staging\\.kovagoadi\\.hu$`) || HostRegexp(`^.+\\.dev\\.kovagoadi\\.hu$`)" + entryPoints: + - "web" + service: "dev-staging" + priority: 1000 + services: + dev-staging: + loadBalancer: + servers: + - url: "http://staging:8080" + +tcp: + routers: + # Router for HTTPS (Passthrough) + dev-staging-secure: + rule: "HostSNIRegexp(`^.+\\.staging\\.kovagoadi\\.hu$`) || HostSNIRegexp(`^.+\\.dev\\.kovagoadi\\.hu$`)" + service: "dev-staging-secure" + # Passthrough must be true for SSL to reach Nginx encrypted + tls: + passthrough: true + priority: 1000 + entryPoints: + - "https" + services: + dev-staging-secure: + loadBalancer: + servers: + # Note: Ensure Traefik trusts the cert at .85 or set insecureSkipVerify + - address: "staging:445" \ No newline at end of file