首先,在linux系统的/etc/init.d/目录下创建nginx文件,使用如下命令: vim /etc/init.d/nginx 在脚本中添加如下命令: #!/bin/sh # # nginx - this script starts and stops the nginx daemon # # chkconfig: - # description: NGINX is an HTTP(S) server, HTTP(S) reverse \ # proxy and IMAP/POP3 pro
一.设置nginx的开机自启动方法 1.在/etc/init.d/目录下创建nginx文件 vi /etc/init.d/nginx 编写内容如下: #!/bin/sh # # nginx - this script starts and stops the nginx daemon # # chkconfig: - 85 15 # description: NGINX is an HTTP(S) server, HTTP(S) reverse \ # proxy and IMAP/POP3 p