-
-
Save lunaczp/fde3fed6ad0d14be9d2c065de34a9718 to your computer and use it in GitHub Desktop.
OpenResty Centos 7 启动脚本配置
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # OpenResty 默认安装在 /usr/local/openresty | |
| # 该文件应该放在 /usr/lib/systemd/system/nginx.service | |
| # 放好后请运行: | |
| # - systemctl enable nginx.service | |
| # - systemctl start nginx.service | |
| # 然后之后就可以用 service nginx [start/reload/stop] 等命令了 | |
| [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/openresty/nginx/logs/nginx.pid | |
| ExecStartPre=/usr/local/openresty/nginx/sbin/nginx -t | |
| ExecStart=/usr/local/openresty/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