Using API when HAProxy is an extension of PFSense

Hello,

I am running HAProxy as a pfSense package for multi-tenant routing (one subdomain per backend, all behind a single 80/443 entry point).

I would like to automate the creation of frontend and backend rules. Is there an API available to modify HAProxy frontend/backend rules when HAProxy is running inside pfSense?

I created a dedicated pfSense user but did not find any privilege related to HAProxy operations.

Thanks.

Hi, you could use the Runtime API via the Data Plane API, or connect to it directly via a UNIX or TCP socket. As I understand, the pre-built pfSense package does not include the Data Plane API by default, so you could try enabling the Runtime API in the HAProxy configuration and connecting to it.

Hi,
Thanks for your participation :slight_smile:
Ha proxy is already deployed in my pfsense.
I found !

I hope it will work :slight_smile:

I do not know pfSense, but there should be a way to update the HAProxy configuration. Maybe it would be better to ask on the pfSense support forum, since the problem seems to be related to pfSense rather than HAProxy.

Okay
First I installed pfSense and I discovered a new world…
When I added the HAProxy extension, I didn’t know it could be a stand alone product.
I have no time now to do that now but I know it’s better to totally separate technologies if it’s possible.
I created an api layer for pfsense to use haproxy…
Thanks for your help