看下nginx命令的帮助信息

[root@localhost oa_workflow_test]# /usr/local/nginx/sbin/nginx -h
nginx version: nginx/1.12.
Usage: nginx [-?hvVtTq] [-s signal] [-c filename] [-p prefix] [-g directives] Options:
-?,-h : this help
-v : show version and exit
-V : show version and configure options then exit
-t : test configuration and exit
-T : test configuration, dump it and exit
-q : suppress non-error messages during configuration testing
-s signal : send signal to a master process: stop, quit, reopen, reload
-p prefix : set prefix path (default: /usr/local/nginx/)
-c filename : set configuration file (default: conf/nginx.conf)
-g directives : set global directives out of configuration file

查看nginx版本

[root@localhost ~]# nginx -v (注意是小v)
nginx version: nginx/1.12.

查看nginx安装了哪些模块

[root@localhost ~]# nginx -V(注意是大V)
nginx version: nginx/1.12.
built by gcc 4.8. (Red Hat 4.8.-) (GCC)
built with OpenSSL 1.0.1e-fips Feb
TLS SNI support enabled
configure arguments: --user=www --group=www --prefix=/usr/local/nginx --with-http_ssl_module --with-http_stub_status_module --with-threads

可以格式化后显示

[root@localhost ~]# nginx -V >& | sed "s/\s\+--/\n --/g"
nginx version: nginx/1.12.
built by gcc 4.8. (Red Hat 4.8.-) (GCC)
built with OpenSSL 1.0.1e-fips Feb
TLS SNI support enabled
configure arguments:
--user=www
--group=www
--prefix=/usr/local/nginx
--with-http_ssl_module
--with-http_stub_status_module
--with-threads

重读nginx配置文件

[root@localhost conf]# /usr/local/nginx/sbin/nginx -s reopen

 检查配置文件是否正确

-t 参数 ,不运行nginx,而仅仅测试配置文件。nginx 将检查配置文件的语法的正确性,并尝试打开配置文件中所引用到的文件。

[root@localhost conf]# /usr/local/nginx/sbin/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

后面也可以指定配置文件地址

[root@oa-dev conf]# /opt/app/nginx/sbin/nginx -t -c /opt/app/nginx/conf/nginx.conf
nginx: [warn] "ssl_stapling" ignored, issuer certificate not found for certificate "/opt/app/nginx/conf/ssl/server2018.crt"
nginx: the configuration file /opt/app/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /opt/app/nginx/conf/nginx.conf test is successful

查看nginx进程信息

[root@oa-dev conf]# ps -ef|grep nginx
root : ? :: nginx: master process /opt/app/nginx/sbin/nginx
nobody : ? :: nginx: worker process
nobody : ? :: nginx: worker process

nginx -h 查看帮助信息
nginx -v 查看Nginx的版本号
nginx -V 显示Nginx的版本号和编译信息
start nginx 启动Nginx
nginx -s stop 快速停止和关闭Nginx
nginx -s quit 正常停止或关闭Nginx
nginx -s reload 配置文件修改重新加载
nginx -t 测试Nginx配置文件的正确性及配置文件的详细信息

【nginx】nginx日常命令的更多相关文章

  1. nginx的日常应用

    nginx的配置文件nginx.conf配置详解如下: user nginx nginx ; Nginx用户及组:用户 组.window下不指定 worker_processes ; 工作进程:数目. ...

  2. Nginx启动停止命令

    操作环境是Windows 一.nginx命令:启动nginx 在Windows上安装好nginx后,我们需要启动nginx服务,启动nginx服务的命令行操作主要有两种方式,即 cd D:\opens ...

  3. window下nginx的常用命令

    window nginx 启动 常用命令 2016-05-04 11:11 214人阅读 评论(0) 收藏 举报 分类: nginx(5) 版权声明:本文为博主原创文章,未经博主允许不得转载. 启动 ...

  4. nginx 支持的命令行参数

    Command-line parameters 命令行参数 nginx supports the following command-line parameters: nginx支持以下命令行参数 - ...

  5. ubuntu和centos 编译安装nginx及常用命令

    转自http://www.cnblogs.com/piscesLoveCc/p/5794926.html 一. ubuntu安装 1. 安装依赖库 安装gcc g++的依赖库 ubuntu平台可以使用 ...

  6. nginx中有关命令和日志切割,配置文件加载的详细阐述

    一.Nginx简介 Nginx (“engine x”) 是俄罗斯人Igor Sysoev(塞索耶夫)编写的一款高性能的 HTTP 和反向代理服务器.Nginx 已经在俄罗斯最大的门户网站── Ram ...

  7. linux安装jdk tomcat nginx 以及常用命令

    linux: 操作系统,应用服务器上 常用命令: cd 切换命令 cd / cd ~ cd ../../ cd xx ll 展示所有的文件 ll -h 友好的展示 mkdir 创建目录 mkdir 目 ...

  8. 配置nginx的systemctl命令

    启动nginx的命令为     /usr/local/nginx/sbin/nginx  停止nginx的命令为    /usr/local/nginx/sbin/nginx -s stop 重启ng ...

  9. nginx配置, 启动命令, 反向代理配置

    2014年1月3日 13:52:07 喜欢这样的风格,干货 http://huoding.com/2013/10/23/290 -----------------下边是我自己的经验(windows)- ...

随机推荐

  1. onScrollChanged()

    转载请标明出处:http://www.cnblogs.com/tangZH/p/8428100.html  onScrollChanged里面有四个参数 @Overrideprotected void ...

  2. <jsp:useBean>、<jsp:setProperty>与<jsp:getProperty>

    <jsp:useBean>标签 会调用java对象的无参构造方法,来创建实例. <jsp:useBean>标签是用来搭配JavaBean元件的标准标签,这里指的JavaBean ...

  3. 关于使用阿里OSS服务搭建图床和使用PicGO上传图片到图床

    最近喜欢上了使用markdown来写博客,可是markdown的图片却是本地的,如果我要发博客,那么又要重复截图了.于是干脆弄了个图床,本地截图的时候上传到图床,markdown中的代码结果也是图床里 ...

  4. Xamarin移动开发的优点和缺点

    在考虑iOS或Android应用程序开发时,我们大多数人会首先考虑Objective-C vs Swift和Java.作为本地技术堆栈,当涉及到iOS和Android应用程序开发时,它们自然是最常用的 ...

  5. python实例二

    https://www.cnblogs.com/evablogs/p/6754974.html 题目:企业发放的奖金根据利润提成.利润(I)低于或等于10万元时,奖金可提10%:利润高于10万元,低于 ...

  6. 【Python 20】BMR计算器4.0(异常处理)

    1.案例描述 基础代谢率(BMR):我们安静状态下(通常为静卧状态)消耗的最低热量,人的其他活动都建立在这个基础上. 计算公式: BMR(男) = (13.7*体重kg)+(5.0*身高cm)-(6. ...

  7. 【入门】Spring-Boot项目配置Mysql数据库

    前言 前面参照SpringBoot官网,自动生成了简单项目点击打开链接 配置数据库和代码遇到的问题 问题1:cannot load driver class :com.mysql.jdbc.Drive ...

  8. iframe 自适应

    <iframe src="http://www.fulibac.com" id="myiframe" scrolling="no" o ...

  9. building 'twisted.test.raiser' extension error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools

    Error msg: building 'twisted.test.raiser' extension error: Microsoft Visual C++ 14.0 is required. Ge ...

  10. Django缓存和内置信号

    缓存 简单概括就是将对数据库操作查询所得到的数据放入另外一台机器上(缓存)中,当用户再次请求时,直接去缓存中拿,避免对数据库的频繁操作,加快数据的显示时间,需要知道的是,缓存里面的数据一般都设置有超时 ...