Make sure fox nginx to wait on authelia (#292)
This commit is contained in:
parent
1bd5810a6d
commit
84e4893665
1 changed files with 9 additions and 0 deletions
|
@ -416,6 +416,15 @@ in
|
||||||
${pkgs.bash}/bin/bash -c '(while ! ${pkgs.netcat-openbsd}/bin/nc -z -v -w1 ${cfg.ldapHostname} ${toString cfg.ldapPort}; do echo "Waiting for port ${cfg.ldapHostname}:${toString cfg.ldapPort} to open..."; sleep 2; done); sleep 2'
|
${pkgs.bash}/bin/bash -c '(while ! ${pkgs.netcat-openbsd}/bin/nc -z -v -w1 ${cfg.ldapHostname} ${toString cfg.ldapPort}; do echo "Waiting for port ${cfg.ldapHostname}:${toString cfg.ldapPort} to open..."; sleep 2; done); sleep 2'
|
||||||
'');
|
'');
|
||||||
|
|
||||||
|
|
||||||
|
# Need to wait on auth endpoint to be available otherwise nginx can fail to start.
|
||||||
|
# For example when DNS server is restarting at the same time or Auth endpoint itself.
|
||||||
|
systemd.services.nginx =
|
||||||
|
{
|
||||||
|
wants = [ "authelia-${fqdn}.service" ];
|
||||||
|
after = [ "authelia-${fqdn}.service" ];
|
||||||
|
};
|
||||||
|
|
||||||
services.nginx.virtualHosts.${fqdn} = {
|
services.nginx.virtualHosts.${fqdn} = {
|
||||||
forceSSL = !(isNull cfg.ssl);
|
forceSSL = !(isNull cfg.ssl);
|
||||||
sslCertificate = lib.mkIf (!(isNull cfg.ssl)) cfg.ssl.paths.cert;
|
sslCertificate = lib.mkIf (!(isNull cfg.ssl)) cfg.ssl.paths.cert;
|
||||||
|
|
Loading…
Reference in a new issue