# Configuration Samples

**URL:** https://discourse.haproxy.org/c/useful-haproxy-configuration-samples/5.md

[Latest](https://discourse.haproxy.org/latest.md) · [Categories](https://discourse.haproxy.org/categories.md)

---

## [About the Configuration Samples category](https://discourse.haproxy.org/t/about-the-configuration-samples-category/13)

<div class="topic-metadata">

**Author:** [@willy](https://discourse.haproxy.org/u/willy)\
**Replies:** 0\
**Last updated:** [December 7, 2015, 4:28pm UTC](https://discourse.haproxy.org/t/about-the-configuration-samples-category/13 "2015-12-07T16:28:58Z")

</div>

Configurations posted here are expected to be useful to the community. They must follow a few rules : configurations must have been tested the oldest known compatible haproxy version must be mentionned whoever the co…

---

## [HAProxy 3.2.19: Review of active/active TCP balancing between two synchronized HSM sites](https://discourse.haproxy.org/t/haproxy-3-2-19-review-of-active-active-tcp-balancing-between-two-synchronized-hsm-sites/13013)

<div class="topic-metadata">

**Author:** [@kerolos.youssef](https://discourse.haproxy.org/u/kerolos.youssef)\
**Replies:** 0\
**Last updated:** [November 16, 2026, 9:28am UTC](https://discourse.haproxy.org/t/haproxy-3-2-19-review-of-active-active-tcp-balancing-between-two-synchronized-hsm-sites/13013 "2026-11-16T09:28:04Z")

</div>

Hello, We use HAProxy 3.2.19 on RHEL 9, installed from the Zenetys package haproxy32z-3.2.19-1.el9.zenetys.x86\_64. Our application connects to HAProxy frontends: Port 9005 forwards to the Excrypt service on backend p…

---

## [Automate your haproxy config](https://discourse.haproxy.org/t/automate-your-haproxy-config/12798)

<div class="topic-metadata">

**Author:** [@Struis](https://discourse.haproxy.org/u/Struis)\
**Replies:** 0\
**Last updated:** [November 3, 2026, 3:27pm UTC](https://discourse.haproxy.org/t/automate-your-haproxy-config/12798 "2026-11-03T15:27:05Z")

</div>

Hi, For all of you, i and ai, made a piece of software , which can help you to build a good configuration for your haproxy. Its based on security rules form the Dutch internet.nl and some other standards. I tested it a…

---

## [ACME Challenge Passthrough](https://discourse.haproxy.org/t/acme-challenge-passthrough/8739)

<div class="topic-metadata">

**Author:** [@davidro](https://discourse.haproxy.org/u/davidro)\
**Replies:** 2\
**Last updated:** [October 9, 2025, 8:26pm UTC](https://discourse.haproxy.org/t/acme-challenge-passthrough/8739 "2025-10-09T20:26:24Z")

</div>

Hi Community, I am doing this in a homeserver set up so even though I use these platforms every day, they have a maximum of 3 - 4 users on them so all are single server, no need to load share etc. My goal was to send t…

---

## [HAProxy VMWare ova Appliance Config](https://discourse.haproxy.org/t/haproxy-vmware-ova-appliance-config/11669)

<div class="topic-metadata">

**Author:** [@guycrimsonbw](https://discourse.haproxy.org/u/guycrimsonbw)\
**Replies:** 0\
**Last updated:** [March 18, 2025, 8:22am UTC](https://discourse.haproxy.org/t/haproxy-vmware-ova-appliance-config/11669 "2025-03-18T08:22:53Z")

</div>

Good day. I have deployed a haproxy 0.20.0 ova appliance for vSphere with Tanzu. I then ran through the workload management deployment on vcenter, but the config gets stuck on the ‘Configured Load Balancer fronting the …

---

## [Syslog load balancing and forwarding client IP to back-end server](https://discourse.haproxy.org/t/syslog-load-balancing-and-forwarding-client-ip-to-back-end-server/8698)

<div class="topic-metadata">

**Author:** [@ramana](https://discourse.haproxy.org/u/ramana)\
**Replies:** 2\
**Last updated:** [February 27, 2025, 6:50pm UTC](https://discourse.haproxy.org/t/syslog-load-balancing-and-forwarding-client-ip-to-back-end-server/8698 "2025-02-27T18:50:54Z")

</div>

Hello All, I am implementing syslog log load balancing using both tcp and udp. and below is configuration toforward logs to backend servers. But I am facing problem to forward the source IP as it is. Please help me to…

---

## [HaProxy Settings for different Auth's for different Backendpools in opnsense](https://discourse.haproxy.org/t/haproxy-settings-for-different-auths-for-different-backendpools-in-opnsense/11571)

<div class="topic-metadata">

**Author:** [@Pakka](https://discourse.haproxy.org/u/Pakka)\
**Replies:** 0\
**Last updated:** [January 26, 2025, 1:33pm UTC](https://discourse.haproxy.org/t/haproxy-settings-for-different-auths-for-different-backendpools-in-opnsense/11571 "2025-01-26T13:33:56Z")

</div>

Hey there I am struggling with the settings in HaProxyplugin in opnsense, where I am trying to assign different authentications to different backend pools in the rules. For example, one backend pool should only be acces…

---

## [Haproxy 2.8 http3 / quic example?](https://discourse.haproxy.org/t/haproxy-2-8-http3-quic-example/11545)

<div class="topic-metadata">

**Author:** [@Dav1](https://discourse.haproxy.org/u/Dav1)\
**Replies:** 1\
**Last updated:** [January 21, 2025, 1:43pm UTC](https://discourse.haproxy.org/t/haproxy-2-8-http3-quic-example/11545 "2025-01-21T13:43:51Z")

</div>

Anyone know how to set it up? haproxy -vv HAProxy version 2.8.5-1ubuntu3.2 2024/12/02 - https://haproxy.org/ Status: long-term supported branch - will stop receiving fixes around Q2 2028. Known bugs: http://www.haproxy.…

---

## [Sharepoint online with OAuth](https://discourse.haproxy.org/t/sharepoint-online-with-oauth/11465)

<div class="topic-metadata">

**Author:** [@idefixgallier](https://discourse.haproxy.org/u/idefixgallier)\
**Replies:** 0\
**Last updated:** [December 10, 2024, 2:33pm UTC](https://discourse.haproxy.org/t/sharepoint-online-with-oauth/11465 "2024-12-10T14:33:07Z")

</div>

We do suffer that sharepoint online sites cannot be made available for the public anymore so we had the idea to setup an url on haproxy and configure the backend with an oauth token (header Authentication Bearer …) What…

---

## [TCP routing based on FQDN](https://discourse.haproxy.org/t/tcp-routing-based-on-fqdn/11260)

<div class="topic-metadata">

**Author:** [@sebm](https://discourse.haproxy.org/u/sebm)\
**Replies:** 3\
**Last updated:** [October 15, 2024, 11:54am UTC](https://discourse.haproxy.org/t/tcp-routing-based-on-fqdn/11260 "2024-10-15T11:54:44Z")

</div>

Hi, I’m trying to route TCP traffic on port 122/tcp to remote SSH server based on the FQDN. Here is my HAProxy configuration : frontend my\_ssh\_frontend bind \*:122 mode tcp option tcplog acl my\_ssh\_acl h…

---

## [HTTPS load balancer - use server](https://discourse.haproxy.org/t/https-load-balancer-use-server/11268)

<div class="topic-metadata">

**Author:** [@rokkotnik](https://discourse.haproxy.org/u/rokkotnik)\
**Replies:** 0\
**Last updated:** [October 10, 2024, 8:09am UTC](https://discourse.haproxy.org/t/https-load-balancer-use-server/11268 "2024-10-10T08:09:04Z")

</div>

Hi all. My question is, if instead of the current config with two backends, if I can use 1 backend and on the frontend or something use the “use-server” to make the config with only 1 backend? global log /dev/log lo…

---

## [Dynamic use\_backend?](https://discourse.haproxy.org/t/dynamic-use-backend/9491)

<div class="topic-metadata">

**Author:** [@Rickard\_505](https://discourse.haproxy.org/u/Rickard_505)\
**Replies:** 4\
**Last updated:** [September 27, 2024, 10:53am UTC](https://discourse.haproxy.org/t/dynamic-use-backend/9491 "2024-09-27T10:53:17Z")

</div>

How can i get the ACL and USE\_BACKEND below to a dynamic one (or two) liner(s) ? the domain in ACL - has the info needed for the backend statement imho. (either by its own name or its value) and - yes - I NEED to use s…

---

## [Bytes Counts and Term code is --](https://discourse.haproxy.org/t/bytes-counts-and-term-code-is/10188)

<div class="topic-metadata">

**Author:** [@adnanhamdussalam](https://discourse.haproxy.org/u/adnanhamdussalam)\
**Replies:** 0\
**Last updated:** [September 6, 2024, 10:43am UTC](https://discourse.haproxy.org/t/bytes-counts-and-term-code-is/10188 "2024-09-06T10:43:31Z")

</div>

I am trying to connect with two standby postgresql servers using haproxy one standby server is configured against pgbouncer port 6432 (10.114.16.33) and other on with postgresql port 5432 (10.114.16.34) but when I connec…

---

## [Extended Master secret key is set to "No"](https://discourse.haproxy.org/t/extended-master-secret-key-is-set-to-no/10035)

<div class="topic-metadata">

**Author:** [@Gajanana](https://discourse.haproxy.org/u/Gajanana)\
**Replies:** 1\
**Last updated:** [July 17, 2024, 8:05am UTC](https://discourse.haproxy.org/t/extended-master-secret-key-is-set-to-no/10035 "2024-07-17T08:05:40Z")

</div>

The haproxy.cfg has min support of TLS version 1.2 and a set of specific ciphers e.g. “ECDHE-RSA-AES256-GCM-SHA384” to be allowed for communication. When i run the following command: openssl s\_client -connect \<\> | grep…

---

## [Tcp synchronisation with LVM + HA Proxy + web server (cluster 2 node each)](https://discourse.haproxy.org/t/tcp-synchronisation-with-lvm-ha-proxy-web-server-cluster-2-node-each/9982)

<div class="topic-metadata">

**Author:** [@filerem](https://discourse.haproxy.org/u/filerem)\
**Replies:** 1\
**Last updated:** [July 2, 2024, 9:09am UTC](https://discourse.haproxy.org/t/tcp-synchronisation-with-lvm-ha-proxy-web-server-cluster-2-node-each/9982 "2024-07-02T09:09:56Z")

</div>

Hello everyone, I’m new to clustering, I have a configuration that works, but I have a problem and I don’t know if I’m doing things right or not. I’ll explain my config to you: I have a cluster of 2 ha-proxy in revers…

---

## [Passing https: to 443 to tomcat:8443](https://discourse.haproxy.org/t/passing-https-to-443-to-tomcat-8443/9894)

<div class="topic-metadata">

**Author:** [@chriskuku](https://discourse.haproxy.org/u/chriskuku)\
**Replies:** 2\
**Last updated:** [June 7, 2024, 8:10am UTC](https://discourse.haproxy.org/t/passing-https-to-443-to-tomcat-8443/9894 "2024-06-07T08:10:27Z")

</div>

I’m running haproxy 2.8.3 with tomcat9 as a backend server. How would I have to configure haproxy such that it serves the address: HAPROXY TOMCAT9 https://cms.site.org/ ==\> https://cms.site.or…

---

## [Url redirect from origin path](https://discourse.haproxy.org/t/url-redirect-from-origin-path/9777)

<div class="topic-metadata">

**Author:** [@frank66](https://discourse.haproxy.org/u/frank66)\
**Replies:** 0\
**Last updated:** [April 24, 2024, 8:57am UTC](https://discourse.haproxy.org/t/url-redirect-from-origin-path/9777 "2024-04-24T08:57:47Z")

</div>

Hello everyone, my pfsense uses haproxy with name fqdn and certified e.g. mypfsense.fqdn:3421 . I would like to know how to use this name for a redirect path . What I would like to get would be : mypfsense.fqdn:3421/ser…

---

## [Simple two server failover](https://discourse.haproxy.org/t/simple-two-server-failover/7554)

<div class="topic-metadata">

**Author:** [@ledufakademy](https://discourse.haproxy.org/u/ledufakademy)\
**Replies:** 3\
**Last updated:** [March 6, 2024, 12:31pm UTC](https://discourse.haproxy.org/t/simple-two-server-failover/7554 "2024-03-06T12:31:57Z")

</div>

hello, we need to send traffic to a master server1, then when it’s check as down (http check) … only use the backup server2 ? here is our config, do you think it’s enought ? backend web-site-prod descr…

---

## [Set specific access to Stat Page](https://discourse.haproxy.org/t/set-specific-access-to-stat-page/9534)

<div class="topic-metadata">

**Author:** [@BBrugnolo](https://discourse.haproxy.org/u/BBrugnolo)\
**Replies:** 2\
**Last updated:** [February 27, 2024, 11:45am UTC](https://discourse.haproxy.org/t/set-specific-access-to-stat-page/9534 "2024-02-27T11:45:35Z")

</div>

I have a HAProxy configured with 40 backend RDP servers, and i need to allow a few users to put these servers in MAINT and READY status only. Is this possible?

---

## [Https over Lan internal IP reverse proxy to internal client in network connection](https://discourse.haproxy.org/t/https-over-lan-internal-ip-reverse-proxy-to-internal-client-in-network-connection/9527)

<div class="topic-metadata">

**Author:** [@keng](https://discourse.haproxy.org/u/keng)\
**Replies:** 0\
**Last updated:** [February 24, 2024, 10:04pm UTC](https://discourse.haproxy.org/t/https-over-lan-internal-ip-reverse-proxy-to-internal-client-in-network-connection/9527 "2024-02-24T22:04:42Z")

</div>

Hi, How to configure to all client internal ip network can connect directly by haproxy reverse proxy by local domain provide the https connection to them, now external 443 pass through to 80 backend server is working bu…

---

## [Oracle OEM setup with HAProxy](https://discourse.haproxy.org/t/oracle-oem-setup-with-haproxy/9442)

<div class="topic-metadata">

**Author:** [@ngupta](https://discourse.haproxy.org/u/ngupta)\
**Replies:** 1\
**Last updated:** [January 25, 2024, 5:20pm UTC](https://discourse.haproxy.org/t/oracle-oem-setup-with-haproxy/9442 "2024-01-25T17:20:38Z")

</div>

I am in the process of setting up HAProxy for Oracle OEM traffic as below: OMS server (SSL) → HAProxy server → Multiple DB servers (SSL) HAProxy is not able to identify for which DB server traffic is to go to hence sen…

---

## [Quickstart HAProxy Community Edition dataplaneAPI](https://discourse.haproxy.org/t/quickstart-haproxy-community-edition-dataplaneapi/9164)

<div class="topic-metadata">

**Author:** [@randomguy](https://discourse.haproxy.org/u/randomguy)\
**Replies:** 8\
**Last updated:** [January 20, 2024, 11:34am UTC](https://discourse.haproxy.org/t/quickstart-haproxy-community-edition-dataplaneapi/9164 "2024-01-20T11:34:22Z")

</div>

This guide was written after starting up a brand new Ubuntu Server on 22.04 and details the steps taken to quickly get the dataplaneapi up and running. sudo apt-get update sudo apt-get install haproxy Run this to see w…

---

## [Error on acl and backend](https://discourse.haproxy.org/t/error-on-acl-and-backend/9313)

<div class="topic-metadata">

**Author:** [@malvivent7](https://discourse.haproxy.org/u/malvivent7)\
**Replies:** 0\
**Last updated:** [December 12, 2023, 3:42pm UTC](https://discourse.haproxy.org/t/error-on-acl-and-backend/9313 "2023-12-12T15:42:20Z")

</div>

Hi to all, i have an installation of HAproxy 2.4.22 on ubuntu 22.04LTS (package from distro rep) i succesfuly deployed on production this installation with maps for choosing backend based on host from the request… now i …

---

## [Use MAP with ACL Runtime API not with use\_backend](https://discourse.haproxy.org/t/use-map-with-acl-runtime-api-not-with-use-backend/9139)

<div class="topic-metadata">

**Author:** [@community.primp716](https://discourse.haproxy.org/u/community.primp716)\
**Replies:** 0\
**Last updated:** [October 20, 2023, 5:44am UTC](https://discourse.haproxy.org/t/use-map-with-acl-runtime-api-not-with-use-backend/9139 "2023-10-20T05:44:42Z")

</div>

Hello I want to setup ACL with using the Maps, but I’m not sure if we can setup similar settings. This is the current config. frontend master use\_backend slow if { be\_conn(master\_backend) gt 100 } use\_ba…

---

## [Access Internet Through Proxy](https://discourse.haproxy.org/t/access-internet-through-proxy/7575)

<div class="topic-metadata">

**Author:** [@kolo](https://discourse.haproxy.org/u/kolo)\
**Replies:** 6\
**Last updated:** [September 20, 2023, 7:12am UTC](https://discourse.haproxy.org/t/access-internet-through-proxy/7575 "2023-09-20T07:12:29Z")

</div>

Hi Community! I have problem with accessing internet through proxy. Here’s the configuration. frontend main bind \*:5000 #acl url\_static path\_beg -i /static /images /javascript /stylesheets #acl url\_static…

---

## [Add Backend and ACL with wildcard](https://discourse.haproxy.org/t/add-backend-and-acl-with-wildcard/8822)

<div class="topic-metadata">

**Author:** [@Sharonhac](https://discourse.haproxy.org/u/Sharonhac)\
**Replies:** 0\
**Last updated:** [July 4, 2023, 6:49am UTC](https://discourse.haproxy.org/t/add-backend-and-acl-with-wildcard/8822 "2023-07-04T06:49:40Z")

</div>

Hi , We have HAProxy as a middleware for Kafka brokers on cloud , we have few clusters that might be created in the same domain suffix and we’d like to add routing for all using a unified wildcard ACL and Backend … is …

---

## [Multiple ACLs evaluation in replace-path](https://discourse.haproxy.org/t/multiple-acls-evaluation-in-replace-path/8800)

<div class="topic-metadata">

**Author:** [@bikrmj](https://discourse.haproxy.org/u/bikrmj)\
**Replies:** 0\
**Last updated:** [June 26, 2023, 6:34pm UTC](https://discourse.haproxy.org/t/multiple-acls-evaluation-in-replace-path/8800 "2023-06-26T18:34:19Z")

</div>

We had been using this configuration for long time to rewrite requests to backends and it was working perfectly acl is\_static hdr(host) -i static.example.com acl is\_staticfiles url\_beg /static/ http-request replace-path…

---

## [SSL offloading in both direction](https://discourse.haproxy.org/t/ssl-offloading-in-both-direction/8767)

<div class="topic-metadata">

**Author:** [@hunter4224](https://discourse.haproxy.org/u/hunter4224)\
**Replies:** 2\
**Last updated:** [June 13, 2023, 9:42am UTC](https://discourse.haproxy.org/t/ssl-offloading-in-both-direction/8767 "2023-06-13T09:42:47Z")

</div>

Hello all! i’m need help regards this configuration that i have started and before complete it. I need to realize the follow situation: I have multiple internal server that can listen only in clear (http and snmp). W…

---

## [HAProxy 101 - Basic Configuration Throwing Errors](https://discourse.haproxy.org/t/haproxy-101-basic-configuration-throwing-errors/8735)

<div class="topic-metadata">

**Author:** [@pndjrpauln](https://discourse.haproxy.org/u/pndjrpauln)\
**Replies:** 1\
**Last updated:** [June 2, 2023, 8:23am UTC](https://discourse.haproxy.org/t/haproxy-101-basic-configuration-throwing-errors/8735 "2023-06-02T08:23:31Z")

</div>

Problems getting started - the most rudimentary config file throwing errors Config File: (yes that’s all of it) global maxconn 10000 stats socket /var/run/haproxy.stat mode 600 level admin log 1…

---

## [Serve specific file if path begin](https://discourse.haproxy.org/t/serve-specific-file-if-path-begin/8694)

<div class="topic-metadata">

**Author:** [@malvivent7](https://discourse.haproxy.org/u/malvivent7)\
**Replies:** 0\
**Last updated:** [May 19, 2023, 8:51am UTC](https://discourse.haproxy.org/t/serve-specific-file-if-path-begin/8694 "2023-05-19T08:51:00Z")

</div>

Good day, i have a question. It’s possible to serve a specific file if request path begin with a particular url? example if the request is https://\<domain.com\>/image.png instead to redirect to the backend serve image.png…

[Next page](https://discourse.haproxy.org/c/useful-haproxy-configuration-samples/5.md?page=1)
