mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-14 06:00:33 +03:00
nixos/haproxy: remove broken default 'config'
HAProxy fails to start with the default 'config'. Better disable it and assert that the user provides a suitable 'config'. (AFAICS, there cannot really be a default config file for HAProxy.)
This commit is contained in:
parent
419a4166a7
commit
ffb4797dd3
1 changed files with 7 additions and 36 deletions
|
@ -18,42 +18,8 @@ with lib;
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkOption {
|
config = mkOption {
|
||||||
type = types.lines;
|
type = types.nullOr types.lines;
|
||||||
default =
|
default = null;
|
||||||
''
|
|
||||||
global
|
|
||||||
log 127.0.0.1 local6
|
|
||||||
maxconn 24000
|
|
||||||
daemon
|
|
||||||
nbproc 1
|
|
||||||
|
|
||||||
defaults
|
|
||||||
mode http
|
|
||||||
option httpclose
|
|
||||||
|
|
||||||
# Remove requests from the queue if people press stop button
|
|
||||||
option abortonclose
|
|
||||||
|
|
||||||
# Try to connect this many times on failure
|
|
||||||
retries 3
|
|
||||||
|
|
||||||
# If a client is bound to a particular backend but it goes down,
|
|
||||||
# send them to a different one
|
|
||||||
option redispatch
|
|
||||||
|
|
||||||
monitor-uri /haproxy-ping
|
|
||||||
|
|
||||||
timeout connect 7s
|
|
||||||
timeout queue 300s
|
|
||||||
timeout client 300s
|
|
||||||
timeout server 300s
|
|
||||||
|
|
||||||
# Enable status page at this URL, on the port HAProxy is bound to
|
|
||||||
stats enable
|
|
||||||
stats uri /haproxy-status
|
|
||||||
stats refresh 5s
|
|
||||||
stats realm Haproxy statistics
|
|
||||||
'';
|
|
||||||
description = ''
|
description = ''
|
||||||
Contents of the HAProxy configuration file,
|
Contents of the HAProxy configuration file,
|
||||||
<filename>haproxy.conf</filename>.
|
<filename>haproxy.conf</filename>.
|
||||||
|
@ -66,6 +32,11 @@ with lib;
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
|
||||||
|
assertions = [{
|
||||||
|
assertion = cfg.config != null;
|
||||||
|
message = "You must provide services.haproxy.config.";
|
||||||
|
}];
|
||||||
|
|
||||||
systemd.services.haproxy = {
|
systemd.services.haproxy = {
|
||||||
description = "HAProxy";
|
description = "HAProxy";
|
||||||
after = [ "network.target" ];
|
after = [ "network.target" ];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue