21 votes

Does HAProxy support logging to a file?

Haproxy simply doesn't support logging to files. As stated in the documentation (https://cbonte.github.io/haproxy-dconv/1.8/configuration.html#3.1-log), the "log" statement takes as first parameter an ...
smaftoul's user avatar
  • 345
11 votes

Does HAProxy support logging to a file?

You can change haproxy log config file under /etc/rsyslog.d/ to point the file to the path you like. Not sure about other distribution. For me, I'm using Debian. I changed /etc/rsyslog.d/49-haproxy....
Fonzie's user avatar
  • 356
7 votes

Does HAProxy support logging to a file?

Since version 1.9 HAProxy supports logging to stdout and stderr. With that in mind it's pretty trivial to pipe it to a file. # change haproxy.cfg file with the following global log stdout local0 ...
Frankie's user avatar
  • 221
3 votes

HAPROXY traffic logs not logging in /var/log/haproxy.log

I think because by default the haproxy uses the rsyslog, so a configuration with the following is needed: Create/open a file as vim /etc/rsyslog.d/haproxy-rsyslog.conf, add the following snippet: $...
O.Caliari's user avatar
  • 131
3 votes

HAproxy - add path to backend server

These reqreps are usually too cumbersome to clearly understand. You can use set-path http-request set-path /modules/navigator/www%[path] in either frontend or backend. Then you get /modules/...
Andrey Regentov's user avatar
2 votes

Is it possible to change config file location in haproxy?

Here's an example of a simple file I once created in an environment where I had limited flexibility and wasn't using any service control mechanisms. This script was executable and in the path, and ...
Michael - sqlbot's user avatar
2 votes
Accepted

HaProxy 1.5.8 to FTP server

After much research and some investigation with my colleague on this, this is what was happening: HaProxy could have been a viable solution. But, the FTP server is configured to force passive mode. ...
ryekayo's user avatar
  • 4,763
2 votes

How to start HAProxy on CentOS with systemd

You need to start haproxy in a mode that runs in foreground. Furthermore, if you want to use Type=notify, you need haproxy to implement the systemd notify daemon. It looks like you should start it ...
filbranden's user avatar
  • 21.8k
2 votes

Getting "ERROR 1364 (HY000): Field 'ssl_cipher' doesn't have a default value" Error using mariadb

It's likely you are running mariadb with SSL enabled but don't have a cipher set. You have two options: start the server without SSL enabled if you don't require encrypted connections (remove the -...
slowko's user avatar
  • 321
2 votes
Accepted

Run Haproxy 2.6.7 as service on CentOS 9

There is one solution and one workaround (without really caring about the root cause): here is the workaround: if we install HAProxy using yum first (currently it is of an older version 2.4) and then ...
kavehmb2000's user avatar
1 vote
Accepted

How to redirect rsyslog messges from a specific unix socket to a different log file without duplication?

Restricting processing is done with rulesets. These allow you to group a set of filters together and apply them only to a given input. Filters outside of a ruleset only receive the other input as ...
meuh's user avatar
  • 51.5k
1 vote
Accepted

haproxy: command not found

Probably the executable is installed in a directory that isn't in your $PATH. You can run dpkg -L haproxy to see exactly where things were installed. On an Ubuntu 20.04 system, if I apt install ...
larsks's user avatar
  • 34.9k
1 vote
Accepted

Where does each of my local facilities logs to in Unix?

The linked answer is pretty clear if you take the time to read and understand it and the rsyslog.conf man page but, in short: Like all other syslog facilities, the rule defining what happens to local6 ...
cas's user avatar
  • 78.7k
1 vote

Why is HAProxy forwarding HTTP2 requests as HTTP 1.1?

Are you sure that your servers are supporting http/2 without encryption ? Try this: backend servers mode http server S1 XXX.XXX.XXX:80 proto h2 server S2 XXX.XXX.XXX:80 proto h2 If you have ...
Hector Escalona's user avatar
1 vote

Cannot access haproxy stats socket with systemd

Based on meuh's comment, I added a retry option to socat: ExecStart=/bin/sh -c 'echo disable frontend http | /usr/bin/socat stdio unix-connect:/run/haproxy/admin.sock,retry=2' Still not what's ...
some-guy's user avatar
1 vote
Accepted

Filtering Apache log for errors codes

You could match the 11th record with awk: awk '$11 ~ /^[45]0/' logfile Or you could grep for the preceding five numbers separated by '/' plus a space character, the status code and another space ...
Freddy's user avatar
  • 25.6k
1 vote

Getting "ERROR 1364 (HY000): Field 'ssl_cipher' doesn't have a default value" Error using mariadb

I am a beginner using MySQL, and encountered this exact same error. I tried to create a user in the user table, using INSERT INTO rather than using the CREATE USER command. Please read the 6.2.8 ...
Thomas Hedden's user avatar
1 vote

Deployment of haproxy between devices and Syslog server

HAProxy only does TCP, not UDP. If you have systems that can only send syslog messages using UDP, you need something other than HAProxy. One possibility is nginx - mostly known as a web server, but ...
Jenny D's user avatar
  • 13.2k
1 vote
Accepted

Source-MAC Filter iptables

Here are the goals and means for a relay (ie relay1, relay2 or relay3) to correctly handle traffic coming both through default-gateway (10.0.0.1) or through the HAProxy master-relay (10.0.0.254) in ...
A.B's user avatar
  • 36.7k
1 vote

HAproxy - add path to backend server

Have been experimenting with reqrep until I found a working command. I don't really understand what all those characters do, probably there are some too many, but it works! reqrep ^([^\ :]*)\ /(.*) ...
Koenraad's user avatar
1 vote
Accepted

FIPS 140-2 compliance for Apache and Haproxy on CentOS 7

In addition to SSL/TLS, OpenSSL provides general purpose crypto libraries. In context, FIPS-mode merely removes access to all of the algorithms that have not been approved by NIST. If in FIPS mode, ...
Christopher's user avatar
  • 15.9k
1 vote

Why haproxy logs status code 200 when using "http-response set-status <not-200>"?

(@Maciej Asembler answered correctly, but in a way that may not be completely clear, so let me try to rephrase it for future reference.) It works as expected as my backend server returns 200. Why? ...
Greg Dubicki's user avatar
1 vote
Accepted

Why haproxy logs status code 200 when using "http-response set-status <not-200>"?

It works as expected. Your backend returns 200 OK, and this is the status which gets logged. It makes no sense to override these since sysadmins want the ACTUAL backend response data in logs for ...
Maciej Asembler's user avatar
1 vote

Multiple puppetmaster behind load balancer

Solution: I found issue and you won't believe it was network MTU size issue. Openstack VM use MTU 1400 default and rest of the world use MTU 1500 As soon as i change MTU 1400 on puppet client machine ...
Satish's user avatar
  • 1,652
1 vote

Public HTTP/HAProxy server also is a VPN.... should it do both?

You could continue down this path, but I'm going to suggest taking a step back and trying a rather different approach. You have a bunch of servers. You want them to be able to talk to each other, ...
Xiong Chiamiov's user avatar
1 vote
Accepted

Use HAProxy to tunnel SSH through https

You must set apache on other port. Internet-(443) ---- (443)-HAP-|-----(22) SSH |-----(Other port ex 8443) apache Else use sslh, work fine for https, ssh, xmpp.
seb's user avatar
  • 172
1 vote

Iptables can't forward from/to internal LAN with proxmox

I had the very same problem with a Proxmox server hosting a few containers. One of these was a Gitlab server. From one of the containers or even from the host, I couldn't clone any of the repos. The ...
X99's user avatar
  • 169

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