chkconfig --level 345 nginx on For this command, you must first have the nginx startup configuration file under /etc/init.d. There are many such configuration files on the Internet. But this configuration file needs to be adjusted accordingly with the directory of your nginx program and the directory of the configuration file.
My opinion is to simply write /usr/local/nginx/html/nginx into /etc/rc.local. It will also be started at boot, but it will be executed after the programs in the respective levels are started. The effect is the same, and other programs will basically not rely on nginx to start.
chkconfig --level 345 nginx on For this command, you must first have the nginx startup configuration file under /etc/init.d. There are many such configuration files on the Internet. But this configuration file needs to be adjusted accordingly with the directory of your nginx program and the directory of the configuration file.
My opinion is to simply write /usr/local/nginx/html/nginx into /etc/rc.local. It will also be started at boot, but it will be executed after the programs in the respective levels are started. The effect is the same, and other programs will basically not rely on nginx to start.