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

net/haproxy: multiple map file rules in a single frontend are not working #4391

Open
2 tasks done
viragomann opened this issue Dec 10, 2024 · 1 comment
Open
2 tasks done
Labels
upstream Third party issue

Comments

@viragomann
Copy link

Important notices

Before you add a new report, we ask you kindly to acknowledge the following:

Describe the bug
If you create multiple map files of type domain, create rules for each using it, and assign them to a single frontend, only the first one is working, even all domain names are unique.

A use_backend ACL for each is written in the config file one after another. E.g.
use_backend %[req.hdr(host),lower,map_dom(/tmp/haproxy/mapfiles/674879807b26b5.22516524.txt)]
use_backend %[req.hdr(host),lower,map_dom(/tmp/haproxy/mapfiles/67472b11b0a4a9.24401988.txt)]
However, this doesn't work. For domains matching the second or further, you get 503.

To Reproduce

Steps to reproduce the behavior:

  1. Create two map files for domain names with a structure "domain backendpool"
  2. Create a rule for each using them
  3. Create backends as referred in the map files
  4. Create a rule for each backend to use
  5. Assign this rule to a public server

Expected behavior

The domains of both map files should the routed to the proper backend.

Maybe this would work if OPNsense merges the entries of all map files of the same type into a single temporary file, which is added to the fronted config then.
If this is possible OPNsense should throw a warning.

Describe alternatives you considered

If I manually put all domain mappings into a single map file and state only a single rule for it in the public server settings, all is good.
However, with many domains and many backends, you may lose the track in the map file.

Environment

OPNsense 24.7.9 (amd64).
Intel(R) Xeon(R) Platinum 8461V
virtualized on KVM

@AdSchellevis AdSchellevis transferred this issue from opnsense/core Dec 10, 2024
@fraenki
Copy link
Member

fraenki commented Dec 15, 2024

This sounds pretty similar to this report. You may want to check this upstream issue for further details.

@fraenki fraenki added the upstream Third party issue label Dec 15, 2024
@fraenki fraenki changed the title HAproxy - multiple map file rules in a single frontend are not working net/haproxy: multiple map file rules in a single frontend are not working Dec 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream Third party issue
Development

No branches or pull requests

2 participants