创建服务 以CentOS为例,在/etc/systemd/system目录内创建nginx.service文件,并写入如下内容: [Unit] Description=The NGINX HTTP and reverse proxy server After=network-online.targe