если для systemd
[Unit]
Description=Nginx - a high performance http(s) server
After=syslog.target network.target
[Service]
Type=forking
LimitNOFILE=65536
PIDFile=/var/run/nginx.pid
WorkingDirectory=/var/lib/nginx
ExecStart=/usr/sbin/nginx
ExecReload=/usr/sbin/nginx -s reload
ExecStop=/usr/sbin/nginx -s stop
Restart=on-failure
RestartSec=15
[Install]
WantedBy=multi-user.target