查看版本

cd /usr/local/nginx/sbin/
./nginx -v

结果输出:nginx version: nginx/1.16.1

检查配置文件正确性

./nginx -t
nginx: the configuration file /usr/local/nginx//conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx//conf/nginx.conf test is successful

启动和停止

Nginx 启动命令如下:

[root@bogon conf]# ./nginx

停止命令

/usr/local/webserver/nginx/sbin/nginx -s stop              # 停止 Nginx

启动完成后可以查看Nginx进程:

ps -ef | grep nginx

重新加载配置文件

/usr/local/webserver/nginx/sbin/nginx -s reload            # 重新载入配置文件