跳至主要內容

Nginx挂掉重启方法

xw小于 1 分钟NginxNginx

vim /lib/systemd/system/nginx.service

加入重启相关配置文件:

[Service]
Restart=always
RestartSec=1
Type=forking
PIDFile=/run/nginx.pid

重新加载配置文件

systemctl daemon-reload

启动 nginx

systemctl start nginx