centos7 nginx加入服务

2020-03-05 15:02:58 浏览数 (1)

摘自nginx官网文档

将以下内容写入到文件 /lib/systemd/system/nginx.service

代码语言:javascript复制
[Unit]
Description=The NGINX HTTP and reverse proxy server
After=syslog.target network.target remote-fs.target nss-lookup.target

[Service]
Type=forking
PIDFile=/run/nginx.pid
ExecStartPre=/usr/sbin/nginx -t
ExecStart=/usr/sbin/nginx
ExecReload=/usr/sbin/nginx -s reload
ExecStop=/bin/kill -s QUIT $MAINPID
PrivateTmp=true

[Install]
WantedBy=multi-user.target

0 人点赞