Hello folks,
I have following requirements and want to solve it by using Traefik.
- Env: k8s
- Ingress URL: https://subdomain.domain1.com/path
- Destination (external name service): https://domain2.com/prefix-subdomain/path
Sorry if I missed any existing topics when searching, but the only result I found on stackoverflow does not work. AFAIK, replacepathregex
uses only path for regex matching, not full URL.
Any help would be appreciated.
My expectation is something similar to this (but middlewares and/or other k8s CRDs can be used also):
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: domain2-forwarder
spec:
entryPoints:
- web
- websecure
routes:
- kind: Rule
match: HostRegexp(`{subdomain:[^\.]*}\.domain1.com`)
servers:
server1:
url: https://domain2.com/prefix-$subdomain/