继续潜水

导航

 

nginx路径:/etc/nginx/sbin

vi /etc/systemd/system/nginx.service

编辑文件

[Unit]
Description=A high performance web server and a reverse proxy server
After=network.target

[Service]
Type=forking
ExecStart=/etc/nginx/sbin/nginx
ExecReload=/etc/nginx/sbin/nginx -s reload
ExecStop=/etc/nginx/sbin/nginx -s quit
PIDFile=/run/nginx.pid
PrivateTmp=true

[Install]
WantedBy=multi-user.target

开机自启:sudo systemctl enable nginx

posted on 2024-08-01 11:22  继续潜水  阅读(3)  评论(0编辑  收藏  举报