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

    Haproxy block user-agent

    Scheduled Pinned Locked Moved pfSense Packages
    3 Posts 3 Posters 1.4k 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.
    • R
      rlljorge
      last edited by

      Hello there,

      I would like to block some user agents in haproxy like:

      Baiduspider
      Sosospider
      Sogou
      ZumBot
      Yandex

      I found some examples in haproxy community but Didn't make work in pfsense/haproxy, example:

      acl blockedagent hdr_sub(user-agent) -i -f /etc/haproxy/blacklist.agent
      http-request deny if blockedagent

      Thanks in Advance,

      Rodrigo

      Sergei_ShablovskyS 1 Reply Last reply Reply Quote 0
      • B
        Bruno Rodrigo
        last edited by

        This seems to be old news, but I also can't find an answer.
        In my case I need to create ACLs based on the user agent using PFSense, for a certain user agent redirect the traffic to a specific back end.
        Did you find any solution at your end?
        Thanks.

        1 Reply Last reply Reply Quote 0
        • Sergei_ShablovskyS
          Sergei_Shablovsky @rlljorge
          last edited by

          @rlljorge said in Haproxy block user-agent:

          Hello there,

          I would like to block some user agents in haproxy like:

          Baiduspider
          Sosospider
          Sogou
          ZumBot
          Yandex

          I found some examples in haproxy community but Didn't make work in pfsense/haproxy, example:

          acl blockedagent hdr_sub(user-agent) -i -f /etc/haproxy/blacklist.agent
          http-request deny if blockedagent

          And how You resolve it ?

          —
          CLOSE SKY FOR UKRAINE https://youtu.be/_tU1i8VAdCo !
          Help Ukraine to resist, save civilians people’s lives !
          (Take an active part in public protests, push on Your country’s politics, congressmans, mass media, leaders of opinion.)

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.