I thought about simplifying my haproxy configurations. I will end up with
several servers running similar setups. The idea is to split the single
"haproxy.cfg" into several files and combining common parts into separate files
and adding differential config files where appropriate.
Running "haproxy -f /var/opt/haproxyconfigfiles" works fine already, but not
all of my config settings are activated. Some seem to get ignored.
Here is a simplified example of what I am doing:
* 001_globalsettings.cfg:
global
user ...
group ...
* 002_defaultssettings.cfg:
defaults
mode http
...
* 003_frontend.cfg:
frontend http_front
bind *:8080
stats uri /haproxy?stats
default_backend http_back
* 020_default_stats.cfg:
defaults
stats enable
stats hide-version
stats refresh 30s
stats show-node
stats auth admin:password
stats uri /haproxystats
I excluded the backend definitions because I don't think they count here.
Hopefully this example is concise enough to explain what I am doing.
Reading the docs I didn't find information about in which order haproxy reads
the config files. Is this a random order or is the order I specified by
prefixing with "001" considered ?
As you can see I have the "stats uri" multiple times, but only "/haproxy?stats"
is used. This could be explained by a random order.
But "stats auth" is not considered at all and version information is shown
dispite of "stats hide-versions". This could mean that "defaults" from one file
is being overwritten completely by a different file.
Can someone explain to me how haproxy is working ? I would rather not sift
through the sourcecode ;-)