mirror of
https://github.com/IT4Change/gradido.git
synced 2026-02-06 09:56:05 +00:00
make nginx restart automatic on failure
This commit is contained in:
parent
07a3f0d3a9
commit
d3c65cd7f8
@ -104,6 +104,23 @@ ln -s $SCRIPT_PATH/nginx/common /etc/nginx/
|
||||
rmdir /etc/nginx/conf.d
|
||||
ln -s $SCRIPT_PATH/nginx/conf.d /etc/nginx/
|
||||
|
||||
# Make nginx restart automatic
|
||||
mkdir /etc/systemd/system/nginx.service.d
|
||||
# Define the content to be put into the override.conf file
|
||||
CONFIG_CONTENT="[Unit]
|
||||
StartLimitIntervalSec=500
|
||||
StartLimitBurst=5
|
||||
|
||||
[Service]
|
||||
Restart=on-failure
|
||||
RestartSec=5s"
|
||||
|
||||
# Write the content to the override.conf file
|
||||
echo "$CONFIG_CONTENT" | sudo tee /etc/systemd/system/nginx.service.d/override.conf >/dev/null
|
||||
|
||||
# Reload systemd to apply the changes
|
||||
sudo systemctl daemon-reload
|
||||
|
||||
# setup https with certbot
|
||||
certbot certonly --nginx --non-interactive --agree-tos --domains $COMMUNITY_HOST --email $COMMUNITY_SUPPORT_MAIL
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user