r/haproxy • u/TeamHAProxy • Jul 08 '26
Article How to enable post-quantum cryptography and TLS termination with HAProxy
r/haproxy • u/TeamHAProxy • Jul 08 '26
r/haproxy • u/Cornflix244 • Jun 13 '26
I have quite a complicated way my data takes:
internet -> hetzner haproxy -> rathole tunnel -> homelab haproxy -> services
(rathole listenes at 127.0.0.1:443)
This (old) way works:
internet -> (hetzner) rathole tunnel -> homelab haproxy -> services
Why the extra proxy? I want a service for file sharing which has the high download speed from the cloud. All the other traffic is supposed to be forwarded further. I refuse to get an extra ip for that lol.
I tried to set the backend on the tunnel side to ssl verify none and the frontend bind to use ssl. I also set the backend to just localhost:443 and no ssl on the frontend bind. Both cause the same ssl error.
My haproxy on hetzner: https://pastebin.com/M8ffiua2
haproxy journalctl output: https://pastebin.com/7cXCqEdr
SSL error: SSL_ERROR_RX_RECORD_TOO_LONG
Both proxies use a cert aquired from certbot *.mydomain.dev
What could be the issue here? I am not that good at SSL.
r/haproxy • u/TeamHAProxy • Jun 05 '26
r/haproxy • u/TeamHAProxy • May 22 '26
r/haproxy • u/TeamHAProxy • May 22 '26
r/haproxy • u/TeamHAProxy • May 13 '26
r/haproxy • u/TeamHAProxy • Apr 28 '26
r/haproxy • u/TeamHAProxy • Apr 10 '26
r/haproxy • u/TeamHAProxy • Apr 09 '26
r/haproxy • u/just-a-dude-ok • Mar 27 '26
r/haproxy • u/TeamHAProxy • Mar 23 '26
r/haproxy • u/TeamHAProxy • Mar 13 '26
r/haproxy • u/amateurdormjanitor • Mar 05 '26
Hi all, thanks in advance for any help you might have to offer.
I'm currently running into a rather strange issue that has had me totally stumped for the last several hours. I'm simply trying to proxy my Proxmox management interface behind HAProxy so that I have full SSL/stricter firewall rules/etc, but I'm met with constant 503s when I try to access the endpoint. Note that this is all in my LAN, not exposed to the internet, obviously.
My configuration is as follows: My firewall is OPNsense, and I'm using the HAProxy plugin. Proxmox is running in my management VLAN. I can access the interface by its hostname or IP address on port 8006 as expected. I'm proxying through my administration HAProxy frontend, as I do with all my other management interfaces like switches, aps, etc., which are all working fine.
I'm not a HAProxy wizard, but I have configured it multiple times on several systems so I definitely have an okayish working knowledge of it. I've ensured that my DNS override is pointing to the correct HAProxy frontend, quadruple checked my rules/conditions, ensured SSL is enabled (but not checked) on the server, ensured the port is correct (8006), disabled health checking, set the server as the default backend pool for the frontend, and pretty much everything else I can think of. Nothing is getting rid of the 503 error.
This is all very strange since I have identical configuration for all my other management interfaces, and they all work fine, but for whatever reason, Proxmox is being extremely difficult. This is also my first time using OPNsens (I'm usually a pfSense guy), and I'm having a bit of trouble getting HAProxy to give me any useful logs, which has compounded my troubleshooting.
I'm open to pretty much any suggestion here, and once again, thanks for any input. Finally, here's my full HAProxy config:
#
# Automatically generated configuration.
# Do not edit this file manually.
#
global
uid 80
gid 80
chroot /var/haproxy
daemon
stats socket /var/run/haproxy.socket group proxy mode 775 level admin
nbthread 4
hard-stop-after 60s
no strict-limits
maxconn 10000
limited-quic
httpclient.resolvers.prefer ipv4
tune.ssl.default-dh-param 4096
spread-checks 2
tune.bufsize 16384
tune.lua.bool-sample-conversion normal
tune.lua.maxmem 0
log /var/run/log local0 info
lua-prepend-path /tmp/haproxy/lua/?.lua
defaults
log global
option redispatch -1
maxconn 5000
timeout client 30s
timeout connect 30s
timeout server 30s
retries 3
default-server init-addr last,libc
default-server maxconn 5000
# autogenerated entries for ACLs
# autogenerated entries for config in backends/frontends
# autogenerated entries for stats
# Public Service: Admin_HTTP_Frontend (Listening on 10.0.20.1:80)
frontend Admin_HTTP_Frontend
bind 10.0.20.1:80 name 10.0.20.1:80
mode http
option http-keep-alive
# logging options
# CONDITION: NoSSL_condition
acl acl_699b637a917578.96201502 ssl_fc
# RULE: HTTP_to_HTTPS_rule
http-request redirect scheme https code 301 if !acl_699b637a917578.96201502
# Public Service: Admin_HTTPS_frontend (Listening on 10.0.20.1:443)
frontend Admin_HTTPS_frontend
http-response set-header Strict-Transport-Security "max-age=15768000"
bind 10.0.20.1:443 name 10.0.20.1:443 ssl curves secp384r1 prefer-client-ciphers ciphers ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256 ciphersuites TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256 alpn h2,http/1.1 crt-list /tmp/haproxy/ssl/699fb4394f9419.96453892.certlist
mode http
option http-keep-alive
# logging options
# CONDITION: FW1_condition
acl acl_699b6a37ebfe34.02894762 hdr(Host) -i fw1.home.example.com
# CONDITION: Switch1_condition
acl acl_699ba8ed12c446.65075432 hdr(Host) -i switch1.home.example.com
# CONDITION: AP1_condition
acl acl_699e43e198e1b0.61616432 hdr(Host) -i ap1.home.example.com
# CONDITION: NAS1_condition
acl acl_699e48645400c6.77972048 hdr(Host) -i nas1.home.example.com
# CONDITION: Hyper1_condition
acl acl_69a8cbba143792.24371812 hdr(Host) -i hyper1.home.example.com
# RULE: OPNsense_rule
use_backend FW1 if acl_699b6a37ebfe34.02894762
# RULE: Switch1_rule
use_backend Switch1 if acl_699ba8ed12c446.65075432
# RULE: AP1_rule
use_backend AP1 if acl_699e43e198e1b0.61616432
# RULE: NAS1_rule
use_backend NAS1 if acl_699e48645400c6.77972048
# RULE: Hyper1_rule
use_backend Hyper1_pool if acl_69a8cbba143792.24371812
# Backend Pool: SSL_Backend ()
backend SSL_Backend
# health checking is DISABLED
mode tcp
balance source
# stickiness
stick-table type ipv4 size 50k expire 30m
stick on src
server SSL_Server localhost send-proxy-v2 check-send-proxy
# Backend Pool: FW1 ()
backend FW1_pool
# health checking is DISABLED
mode http
balance source
# stickiness
stick-table type ipv4 size 50k expire 30m
stick on src
http-reuse safe
server FW1 opnsense.home.example.com:10433 ssl alpn h2,http/1.1 verify none
# Backend Pool: Switch1 (TP-Link SG2210P)
backend Switch1_pool
# health checking is DISABLED
mode http
balance source
# stickiness
stick-table type ipv4 size 50k expire 30m
stick on src
http-reuse safe
server Switch1 TL-SG2210P.home.example.com:443 ssl alpn h2,http/1.1 verify none
# Backend Pool: AP1 (TP-Link EAP610)
backend AP1_pool
# health checking is DISABLED
mode http
balance source
# stickiness
stick-table type ipv4 size 50k expire 30m
stick on src
http-reuse safe
server AP1 EAP610.home.example.com:443 ssl alpn h2,http/1.1 verify none
# Backend Pool: NAS1 (TrueNAS Server)
backend NAS1_pool
# health checking is DISABLED
mode http
balance source
# stickiness
stick-table type ipv4 size 50k expire 30m
stick on src
http-reuse safe
server NAS1 truenas.home.example.com:443 ssl alpn h2,http/1.1 verify none
# Backend Pool: Hyper1_pool (Proxmox M70q)
backend Hyper1_pool
# health checking is DISABLED
mode http
balance source
# stickiness
stick-table type ipv4 size 50k expire 30m
stick on src
http-reuse safe
server Hyper1 proxmox.home.example.com:8006 ssl alpn h2,http/1.1 verify none
# statistics are DISABLEDEdit: I figured out the (extremely irritating) solution thanks to this thread on Stackoverflow. I somehow had ended up with two HAProxy instances running at once, so any requests I submitted to my Proxmox endpoint were hitting the instance that hadn't been updated with my new config. Killed both instances, started it again, and instantly had the expected behavior!
r/haproxy • u/TeamHAProxy • Feb 27 '26
r/haproxy • u/TeamHAProxy • Feb 26 '26
r/haproxy • u/awesome_pinay_noses • Feb 25 '26
Hello,
I have an old thick application that connects to a cloud service via TLS1.0. The vendor wants to upgrade the API to TLS 1.2 but this will break the application.
I need to create a service to act as a TLS proxy for that.
Currently the application connects to api.example.org which resolves to 1.2.3.4
I will configure my DNS to point to the LB VIP , i.e. 10.10.10.100
The loadbalancer will allow the client to connect to TLS 1.0 and
Client ----> TLS1.0 on Load balancer VIP -------> API service on TLS 1.2
Example config:
listen api.example.org
bind 10.10.10.100:443 transparent
mode tcp
tcp-request content accept if { req_ssl_hello_type 1 }
r/haproxy • u/TeamHAProxy • Feb 19 '26
r/haproxy • u/TeamHAProxy • Feb 09 '26
r/haproxy • u/TeamHAProxy • Feb 03 '26
r/haproxy • u/johnnypea • Jan 28 '26
Following a new automatic ACME tutorial here https://www.haproxy.com/documentation/haproxy-configuration-tutorials/security/ssl-tls/client-side-encryption/#example%3A-let’s-encrypt , can I have one default certificate file for all the dynamically added domains through Data Plane API? Or how should I approach this?
load crt "default.pem" acme letsencrypt-staging domains "example1.com"
load crt "default.pem" acme letsencrypt-staging domains "example2.com"
load crt "default.pem" acme letsencrypt-staging domains "example3.com"Crossposting from community forum https://discourse.haproxy.org/t/default-cert-file-for-automatic-acme/12120
r/haproxy • u/michaelwholley • Jan 24 '26
I'm setting up an HAProxy load balancer for internal websites. I've only worked with HAProxy a handful times before, though I've been a Linux admin for nearly 20 years.
I'm pretty sure there is some configuration I need to adjust, but at it stands, when the load balancer gets hit with a high number of concurrent users, well below the specified max, then it stops accepting new connections. Once I stop my load test of 50 concurrent connections, I have to wait 5ish minutes before any new connection is accepted.
Right now the maxconn value is set globally at 5000. While doing the load test the most I see is 20 concurrent connections for about a minute then the proxy stops. I had htop running the whole time and the CPU never rose above 20% and the memory stayed below 15% utilization. I'm not sure what I've configured incorrectly. Any recommendations of what to look into or how to better troubleshoot it?
I'm running HAProxy 1.8 on Oracle Linux 8.10.
Here is my current config:
#---------------------------------------------------------------------
# See the full configuration options online.
#
# https://www.haproxy.org/download/1.8/doc/configuration.txt
#
#---------------------------------------------------------------------
#---------------------------------------------------------------------
# Global settings
#---------------------------------------------------------------------
global
# to have these messages end up in /var/log/haproxy.log you will
# need to:
# 1) configure local2 events to go to the /var/log/haproxy.log
# file. A line like the following can be added to
# /etc/rsyslog.d/haproxy.conf
#
# local2.* /var/log/haproxy.log
#
log 127.0.0.1 local2
chroot /var/lib/haproxy
pidfile /var/run/haproxy.pid
maxconn 5000
user haproxy
group haproxy
daemon
# turn on stats unix socket
stats socket /var/lib/haproxy/stats
ssl-default-bind-ciphersuites TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256
ssl-default-bind-options prefer-client-ciphers ssl-min-ver TLSv1.3 no-tls-tickets
ssl-default-server-ciphersuites TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256
ssl-default-server-options ssl-min-ver TLSv1.3 no-tls-tickets
ssl-dh-param-file /etc/haproxy/dhparams.pem
#---------------------------------------------------------------------
# common defaults that all the 'listen' and 'backend' sections will
# use if not designated in their block
#---------------------------------------------------------------------
defaults
mode http
log global
option httplog
option log-health-checks
option dontlognull
option http-server-close
option redispatch
retries 3
timeout http-request 10s
timeout queue 1m
timeout connect 60s
timeout client 5m
timeout server 5m
timeout http-keep-alive 10s
timeout check 10s
#---------------------------------------------------------------------
# Frontends for Rancher workers, management, and SMTP relay
#---------------------------------------------------------------------
frontend rancher
bind *:80
bind *:443 ssl crt /etc/ssl/verisys-certs/star-apps-verisys-com_combo.pem
http-request capture req.hdr(host) len 100
redirect scheme https code 301 if !{ ssl_fc }
option forwardfor except 127.0.0.0/8
acl rancher_mgmt_host hdr(host) -i prod-rancher.example.com
acl rancher_mgmt_host hdr(host) -i prod-rancher.example.com:443
acl rancher_mgmt_alt_host hdr(host) -i rancher-cr.example.com
acl rancher_mgmt_alt_host hdr(host) -i rancher-cr.example.com:443
use_backend mgmt-node if rancher_mgmt_host
use_backend mgmt-node if rancher_mgmt_alt_host
default_backend nodes
frontend smtp-relay
mode tcp
bind *:25
log 127.0.0.1 local3
option tcplog
default_backend stmp-nodes
frontend stats
mode http
bind :8404
stats enable
stats refresh 10s
stats uri /stats
#---------------------------------------------------------------------
# HTTPS round robin balancing between the rancher prod nodes
#---------------------------------------------------------------------
backend nodes
balance roundrobin
server lou1ssprchwrk01 10.110.30.101:443 ssl verify none sni req.hdr(Host) check port 5050
server lou1ssprchwrk02 10.110.30.102:443 ssl verify none sni req.hdr(Host) check port 5050
server lou1ssprchwrk03 10.110.30.103:443 ssl verify none sni req.hdr(Host) check port 5050
server lou1ssprchwrk04 10.110.30.104:443 ssl verify none sni req.hdr(Host) check port 5050
server lou1ssprchwrk05 10.110.30.105:443 ssl verify none sni req.hdr(Host) check port 5050
server lou1ssprchwrk06 10.110.30.106:443 ssl verify none sni req.hdr(Host) check port 5050
server lou1ssprchwrk07 10.110.30.107:443 ssl verify none sni req.hdr(Host) check port 5050
server lou1ssprchwrk08 10.110.30.108:443 ssl verify none sni req.hdr(Host) check port 5050
#---------------------------------------------------------------------
# HTTPS round robin balancing between the rancher management node
#---------------------------------------------------------------------
backend mgmt-node
http-request set-header X-Forwarded-Proto https
http-request set-header X-Forwarded-Port 443
server lou1ssprchmgt01 10.110.30.201:8080 sni req.hdr(Host)
#---------------------------------------------------------------------
# 25/TCP round robin balancing between the rancher prod nodes
#---------------------------------------------------------------------
backend stmp-nodes
mode tcp
balance roundrobin
server lou1ssprchwrk01 10.110.30.101:25 send-proxy check port 5050
server lou1ssprchwrk02 10.110.30.102:25 send-proxy check port 5050
server lou1ssprchwrk03 10.110.30.103:25 send-proxy check port 5050
server lou1ssprchwrk04 10.110.30.104:25 send-proxy check port 5050
server lou1ssprchwrk05 10.110.30.105:25 send-proxy check port 5050
server lou1ssprchwrk06 10.110.30.106:25 send-proxy check port 5050
server lou1ssprchwrk07 10.110.30.107:25 send-proxy check port 5050
server lou1ssprchwrk08 10.110.30.108:25 send-proxy check port 5050