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.
This commit is contained in:
Marius 2016-11-09 23:23:45 +01:00
parent 97def4c99f
commit 09a0deaca8
1 changed files with 6 additions and 2 deletions

View File

@ -228,6 +228,10 @@ deploy {
name = "nginx | Create DH parameters" name = "nginx | Create DH parameters"
command = "openssl dhparam -out /etc/nginx/dhparams.pem 2048 creates=/etc/nginx/dhparams.pem" 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" hosts = "tusd"
name = "Restart nginx" name = "Restart nginx"
tasks { tasks {
action = "service name=nginx state=restarted" name = "nginx | Reload configuration"
name = "nginx | Restart" command = "nginx -s reload"
} }
} }
} }