Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Longest matching path does not match when host name is empty #1156

Open
pmint93 opened this issue Aug 2, 2024 · 1 comment
Open

Longest matching path does not match when host name is empty #1156

pmint93 opened this issue Aug 2, 2024 · 1 comment

Comments

@pmint93
Copy link

pmint93 commented Aug 2, 2024

Description of the problem

Rules that has longest path but without host field are put into default backend map, which has lowest precedence, so it won't match if it overlap with other rules that has host field specified

Expected behavior

Traffic of example.com/foo should goes to foo-service
As guided in kubernetes ingress: precedence should be given first to the longest matching path

Steps to reproduce the problem

  1. Create 2 ingresses as bellow:

To route all traffic with prefix /foo to foo-service

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: foo-ingress
spec:
  ingressClassName: haproxy
  rules:
  - http:
      paths:
      - path: /foo
        pathType: Prefix
        backend:
          service:
            name: foo-service
            port:
              number: 80

To route traffic of example.com/ to baz-service

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: baz-ingress
spec:
  ingressClassName: haproxy
  rules:
  - host: example.com
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: baz-service
            port:
              number: 80
  1. Go to http://example.com/foo to see that request are unexpectedly route into baz-service

Environment information

HAProxy Ingress version: v0.14.6

Copy link

github-actions bot commented Sep 2, 2024

This issue got stale and will be closed in 7 days.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 9, 2024
@jcmoraisjr jcmoraisjr reopened this Sep 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants