• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login
Netgate Discussion Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login

HAProxy: adding map file via GUI?

Scheduled Pinned Locked Moved Cache/Proxy
haproxy
3 Posts 2 Posters 1.3k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D
    divemaster90
    last edited by Mar 11, 2023, 4:41 AM

    Hello! I’m trying to add a map file to use in my HAProxy configuration via the package’s GUI. In the “Files” tab, I added the file and gave it a type of “Write to Disk”. When I save, then save the configuration, the file is nowhere to be found. I can still see it in the “Files” tab, but I cannot find it anywhere in the file system. I’m the command prompt, I even tried running find / -name '*filename*' and no results are returned. I’d expect the file to be saved in /var/etc/haproxy just like Lua files, but it’s nowhere to be found. I’ve found nothing that looks like an error in the logs.

    Does anyone know where this file is being saved, if at all? Or is there another way to add a map file that I can reference in my HAProxy config? Thank you!

    1 Reply Last reply Reply Quote 0
    • D
      divemaster90
      last edited by Mar 11, 2023, 8:00 PM

      I am replying to add an update. I also posted to the pfSense issue tracker, and was told that this is not a bug, that files are only written when used by a frontend/backend. I confirmed that this is true, for a frontend I selected the "Write to disk" file that I selected as an error file, and it was indeed written.

      The issue is, though, the only way I can find to have a front/backend to use a file is as an error file. I can add the file as an error file for a non-existent error code (like 12345), but that seems extremely hacky. I tried using the map file in a custom ACL like as follows:

      var(txn.txnhost),lower,map_beg(subdomains.map) -m str -i string1
      

      However, if there's no file written, I can't reference the file in my ACL:

      [ALERT] 069/145712 (574) : parsing [/var/etc/haproxy_test/haproxy.cfg:58] : error detected while parsing ACL 'is_string1' : invalid args in converter 'map_beg' : failed to open pattern file <subdomains.map> in ACL expression 'var(txn.txnhost),lower,map_beg(subdomains.map)'
      

      Is there another way I can add a map file via the GUI without having to add the file as an error file? Thank you!

      1 Reply Last reply Reply Quote 0
      • D divemaster90 referenced this topic on Mar 11, 2023, 8:07 PM
      • M
        marcosm Netgate
        last edited by Mar 12, 2023, 5:13 PM

        That would likely need to be a feature request.

        1 Reply Last reply Reply Quote 0
        3 out of 3
        • First post
          3/3
          Last post
        Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
          This community forum collects and processes your personal information.
          consent.not_received