Skip to content

Instantly share code, notes, and snippets.

@risyasin
Created January 2, 2016 21:21
Show Gist options
  • Save risyasin/2a981bab7586773d849e to your computer and use it in GitHub Desktop.
Save risyasin/2a981bab7586773d849e to your computer and use it in GitHub Desktop.
Nginx service for systemd
[Unit]
Description=The NGINX HTTP and reverse proxy server
After=syslog.target network.target remote-fs.target nss-lookup.target
[Service]
Type=forking
PIDFile=/var/run/nginx.pid
ExecStartPre=/usr/sbin/nginx -t
ExecStart=/usr/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