Skip to content

Instantly share code, notes, and snippets.

@tangnotes
Created July 12, 2018 10:06
Show Gist options
  • Save tangnotes/2b87a5d6015b313224b4e76fed98efe4 to your computer and use it in GitHub Desktop.
Save tangnotes/2b87a5d6015b313224b4e76fed98efe4 to your computer and use it in GitHub Desktop.
Nginx Systemd: /lib/systemd/system/nginx.service
[Unit]
Description=The NGINX HTTP and reverse proxy server
After=syslog.target network.target remote-fs.target nss-lookup.target
[Service]
Type=forking
PIDFile=/usr/local/nginx/logs/nginx.pid
ExecStartPre=/usr/local/nginx/sbin/nginx -t
ExecStart=/usr/local/nginx/sbin/nginx
ExecReload=/usr/local/nginx/sbin/nginx -s reload
ExecStop=/bin/kill -s QUIT $MAINPID
PrivateTmp=true
[Install]
WantedBy=multi-user.target
@tangnotes
Copy link
Author

systemctl enable nginx.service
systemctl is-enabled nginx.service
systemctl is-active nginx.service

systemctl start nginx.service
systemctl restart nginx.service

systemctl stop nginx.service
systemctl status nginx.service

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment