Skip to main content
OverflowAI is here! AI power for your Stack Overflow for Teams knowledge community. Learn more
3 votes

Load balancer with HAProxy

Here is a sample configuration: global slowlog_flat 100 defaults mode http timeout connect 5000ms timeout client 50000ms timeout server 50000ms frontend http bind *:80,*:...
Super22's user avatar
  • 61
3 votes
Accepted

Postfix/Dovecot relay or proxy?

TL;DR: You can use HAproxy in front of SMTP servers that are MX hosts only to do load balancing. You can not use it to select which server to route a request to based on some domain name. All the ...
Nikita Kipriyanov's user avatar
3 votes
Accepted

haproxy.cfg errors in configuration file. Help needed

Your server directive is missing the name. Hence, haproxy uses the address as name, resolvers as the address and so on. Just add a name between server and the address. server node1 k8s-eu-1-control-...
Gerald Schneider's user avatar
2 votes
Accepted

How can I get haproxy to completely ignore SSL handshake errors?

A handshake error cannot be simply ignored and continued with the connection. It is like asking that a car simply continues to drive after a fatal crash. With a handshake error the current connection ...
Steffen Ullrich's user avatar
2 votes

Haproxy log file with pfsense

To be able to enable local logs on HAProxy at pfSense 2.7.0, I had to edit the /etc/defaults/rc.conf file and change the syslogd_flags line to allow the syslog to listen on UDP socket as cited on ...
eduardomozart's user avatar
2 votes
Accepted

Way to keep over 65k TCP connect to a server

My concern is that the server may be limited to 65,535 sockets, given that it can only see the router when connections come from the WAN. Normally, destination NAT aka reverse NAT aka port forwarding ...
Zac67's user avatar
  • 11.9k
2 votes

How to log TLS session keys in HAProxy ala SSLKEYLOGFILE

This is the hacky, awkward way I figured out how to do this. It's not great: Create a lua file sslkeylogger.lua: local function sslkeylog(txn) local fields = { CLIENT_EARLY_TRAFFIC_SECRET ...
Shelvacu's user avatar
  • 426
2 votes

Postfix/Dovecot relay or proxy?

The multiplexing is handled by the application protocol. Haproxy knows HTTP so it can deal with the HTTP traffic. OTOH it doesn't speak SMTP. While you could route the traffic based on Postfix ...
symcbean's user avatar
  • 22.5k
1 vote

LetsEncrypt SSL with HAProxy Renew Not Working

Error message Problem binding to port 8888: Could not bind to IPv4 or IPv6. indicates that some application is already listening on port 8888. Check output of sudo ss -plnt | grep 8888 to find out.
AlexD's user avatar
  • 10.4k
1 vote

How to setup external load balancing to my kubernetes cluster securely?

I think there are two methods on how to do this [1]: HAProxy SSL Passthrough SSL Passthrough does what it says, it takes the connection and throws it to a backend server to decrypt. This could be ...
lsalazar's user avatar
  • 151
1 vote

Postfix/Dovecot relay or proxy?

With postfix you don't need to reverse proxy, postfix can handle multiple domains In your postfix main.cf you create transport_maps = hash:/etc/postfix/transport And also specify for which domains ...
Turdie's user avatar
  • 2,614
1 vote

HAproxy with Keepalived not behaving as expected

How do i make my haproxy listen on my public ip? The simplest solution is to not bind it explicitly to a particular ip address. Instead of this: frontend main bind private_ip1:80 ...
larsks's user avatar
  • 45.3k
1 vote
Accepted

HAProxy always returns 502 Bad Gateway but the backend responds

There are two headers Transfer-Encoding: chunked - one at position 00067 and another at 00646. HAProxy expects only one.
AlexD's user avatar
  • 10.4k
1 vote
Accepted

Django uwsgi behind haproxy: http or http-socket?

haproxy doesn't support uWSGI directly. You need to use http-socket. You can also enable support for PROXY protocol with --http-enable-proxy-protocol to preserve a client's IP address.
AlexD's user avatar
  • 10.4k
1 vote

Client 443/HTTPS -> Virtual IP -> HA Proxy 80/HTTP and 443/HTTPS SSL terminaison -> Varnish 81/HTTP -> 82/HTTPS and 442/HTTPS Apache

Step 1: ensure HAProxy sends the X-Forwarded-Proto header As mentioned in https://stackoverflow.com/questions/77885246/client-443-https-virtual-ip-ha-proxy-80-http-and-443-https-ssl-terminaison/...
Thijs Feryn's user avatar
  • 1,226
1 vote

Forward HTTPS Traffic to a proxy server

Based on Update 2, the only viable solution is to implement an additional proxy between the client and the existing proxy to prefix the stream from the client side with "CONNECT hostname". ...
symcbean's user avatar
  • 22.5k
1 vote

Outbound proxy with multiple public IPs in Azure

There is a NAT gateway https://learn.microsoft.com/en-us/azure/nat-gateway/nat-overview Azure NAT Gateway is a fully managed and highly resilient Network Address Translation (NAT) service. You can use ...
Turdie's user avatar
  • 2,614
1 vote

only allow traffic from one FQDN

I finally got it working. I had to add the IP of my HAProxy as an allowed IP, I also consolidated the nginx config. server { listen 80; charset utf-8; server_name test.mydomain.com; ...
user2236794's user avatar
1 vote
Accepted

Adding custom headers on error responses from haproxy

Setting headers dynamically on error documents is a limitation of HAProxy and there is currently no out-of-the-box feature available to achieve this directly. Since the error is processed before it ...
Rapidmod's user avatar
  • 224
1 vote

Route Docker container traffic through another container

In the most recent versions of docker-compose this can be done using network_mode: "container:name" version: '3' services: nginx_proxy: image: nginx ports: - "8080:80&...
Turdie's user avatar
  • 2,614
1 vote

Can I capture full TCP packet content with haproxy without knowing length of the packet?

I know this is old, but for anyone who comes after: req.payload(0,0) will capture the whole packet. The parameters to payload are an offset and a length; setting the length to zero means to capture ...
Tom's user avatar
  • 357
1 vote

Preserve backend server status when reloading haproxy

Since HAProxy 2.0 it's possible to start a "sidecar" process dataplaneapi exposing REST API, haproxy.cfg: global stats socket /run/haproxy/admin.sock mode 660 level admin program api ...
Tombart's user avatar
  • 2,223
1 vote

HAProxy -- pause/queue all traffic without losing requests

I couldn't manage to use haproxy's approach using set maxconn frontend myfrontend 0 followed by set maxconn frontend myfrontend 1000 because my haproxy crashed when I perform the second command to ...
Svilen Ivanov's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible