Skip to content

Instantly share code, notes, and snippets.

@ethnchao
Created May 29, 2018 06:09
Show Gist options
  • Save ethnchao/ffed6b48a4c8fedcf1ed7adc4239b416 to your computer and use it in GitHub Desktop.
Save ethnchao/ffed6b48a4c8fedcf1ed7adc4239b416 to your computer and use it in GitHub Desktop.
Systemd 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=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID
PrivateTmp=true
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment