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

    HAProxy for User Control Panel (UCP) on freepbx

    Scheduled Pinned Locked Moved Cache/Proxy
    haproxyfreepbx
    4 Posts 2 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.
    • M
      MattiaIppilito
      last edited by MattiaIppilito

      On my pfsense firewall I’m using HAPROXY for some server-services on my home network. I’m trying to use it in the same way with my PBX system which is freepbx.
      Freepbx has different parts…let’s call them an administration side and a user control panel (UCP) side. To get to the main page I type https://freepbx.myowndomain.com and (behind HAProxy is working fine) and on this page I can choose to go to the admin side (https://freepbx.myowndomain.com/admin/…) or to the UCP side (https://freepbx.myowndomain.com/ucp/…..).

      If I proceed to the admin side I get asked for username and password and then I log in and everything works fine; if I proceed to the UCP side I get asked for username and password and after I enter them, the page reloads to a 502 error page.

      I’m not able to make it work. What has to look like the ACL in order to make it work based on the “ucp” presence in the URL?
      Defaulted landing page and admins side are on one backend with its ip+port and UCP page has its own backend with same ip but different port.

      If I access everything by IP address everything is working fine.

      Can anybody help me please? I know nothing about CLI so please be patient and don’t ask to rebuild the whole thing using different software. To me it’s working great the solution of pfsense with HAProxy as a package, so that must be what we have to use…

      Here you have a link by someone else with the same issue, but I don’t understand how and where he could fix it

      https://community.freepbx.org/t/haproxy-as-frontend-for-ucp-backend-phpsessid-repeated-41-times-in-response-why/47933/8

      Thanks.

      1 Reply Last reply Reply Quote 0
      • Q
        qupfer
        last edited by qupfer

        This may be a bit late for you, but for others who stuck with the same problem.
        The "solution" in the other thread doesn't work for me either, but the threat gives me the correct hint. The problem occurs due the many headers.
        The solution, that worked for me:

        Just add tune.http.maxhdr 200 to the "global" part of the haproxy.cfg. That was enough for my system. Maybe, the UCP-Config affect the header size/length.
        If you still have trouble, increase the value or increase the buffer at all may help

        # try first only with tune.http.maxhdr 200
        # try which tune is needed
        # if its work, try to reduce the value to avoid to much memory usage
        tune.bufsize 128000
        tune.http.cookielen 800
        tune.http.maxhdr  400
        
        M 2 Replies Last reply Reply Quote 0
        • M
          MattiaIppilito @qupfer
          last edited by

          @qupfer how can i do that? HAProxy si runnung in pfsense in my case… how/Where do I do those edit? I did not solve the problem yet

          1 Reply Last reply Reply Quote 0
          • M
            MattiaIppilito @qupfer
            last edited by

            I added just that one line into the “Global Advanced pass thru” field in the HAproxy Settings tab…applied the configuration changes and it worked immediately. Thanks. How did you do? Many thanks. How can I mark your reply as “solved the problem”!

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