Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

haproxy - which configuration files

Tags:

haproxy

I have an HAProxy install which was configured by someone who left the company. It runs on Ubuntu 10.04 and it seems to use 3 configuration files in the directory /etc/haproxy

  • haproxy.cfg
  • haproxy.http.cfg
  • haproxy.https.cfg

I don't see the point in using the haproxy.https.cfg file as I believe (in our configuration) it can all be configured from a single haproxy.http.cfg file but when I remove that httpS file it complains bitterly and refuses to run. My question

Is this the standard configuration haproxy uses or if not, I can't find a reference to the "S" file anywhere. Can anyone suggest how HAProxy concludes it should use it?

Thanks

like image 604
user385762 Avatar asked Jul 26 '26 14:07

user385762


1 Answers

The very answer to your question: your haproxy is simply launched with those three config files ( -f haproxy.cfg -f haproxy.http.cfg -f haproxy.https.cfg, maybe from /etc/init.d/haproxy but mileage varies depending on your distribution ).

If you remove the file, of course it will complain.

This is not particularly standard, but ain't bad either, it helps structuring the conf rather than having a very long file.

The task of the .https version will certainly be to redirect the https traffic towards a service that can handle HTTPS (stunnel or nginx usually), since haproxy cannot terminate ssl connections. (stunnel has to be patched, see on the haproxy page)

If you want you can merge those files into one or two, just find out how haproxy is launched (check for init.d or let us know which distribution) and fix it appropriately.

like image 187
Stefano Avatar answered Jul 30 '26 09:07

Stefano