I have been attempting to make an IngressRoute match anything.
This is not working:
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: direct-rpc
spec:
entryPoints:
- {{ .Values.rpcEntryPoint }}
routes:
- match: "HostRegexp(`{.*}`)"
kind: Rule
services:
- name: myservice
port: rpc
The above only seems to work if no host header is set. When I set one it doesn't match and I get 404.
Tests:
# works:
curl localhost:28138
# doesn't work:
curl --header 'Host: example.com' localhost:28138
I have resorted to this:
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: direct-rpc
spec:
entryPoints:
- {{ .Values.rpcEntryPoint }}
routes:
- match: "!HostRegexp(`ahost.thatdoesnot.exist.never`)"
kind: Rule
services:
- name: myservice
port: rpc
What did you see instead?
404 page not found
What version of Traefik are you using?
v2.10.4
What is your environment & configuration?
ports:
rpc:
port: 28100
expose: true
exposedPort: 28100
protocol: TCP
logs:
general:
level: DEBUG
access:
enabled: true
Just standard helm install on K8s cluster with the above values file
If applicable, please paste the log output in DEBUG level
Debug logs just show 404s
192.168.65.4 - - [20/Sep/2023:14:40:37 +0000] "POST / HTTP/1.1" 404 76 "-" "-" 7780 "direct-rp 73234b1b1e8726bbbb2c@kubernetescrd" "http://10.1.3.181:183" 0ms
Is this a bug? I would have expected the regex to match anything. Many thanks.