From 09a0deaca88cb53a7483bc53cab72b82e6d79536 Mon Sep 17 00:00:00 2001 From: Marius Date: Wed, 9 Nov 2016 23:23:45 +0100 Subject: [PATCH] Reload nginx instead of restarting If the restart of nginx fails (e.g. address already in use), the service will not reload the configuration which is usually not wanted. By using nginx(1) and telling it explicitly to reload the configuration, these issues do not appear. --- .infra/Freyfile.hcl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.infra/Freyfile.hcl b/.infra/Freyfile.hcl index e1faacb..35aa878 100644 --- a/.infra/Freyfile.hcl +++ b/.infra/Freyfile.hcl @@ -228,6 +228,10 @@ deploy { name = "nginx | Create DH parameters" command = "openssl dhparam -out /etc/nginx/dhparams.pem 2048 creates=/etc/nginx/dhparams.pem" } + tasks { + name = "nginx | Start service" + service = "name=nginx state=started" + } } } @@ -244,8 +248,8 @@ restart { hosts = "tusd" name = "Restart nginx" tasks { - action = "service name=nginx state=restarted" - name = "nginx | Restart" + name = "nginx | Reload configuration" + command = "nginx -s reload" } } }