看下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. MongoDB 中的【加减乘除】运算

    很多同学因为对MongoDB不熟悉,加之应用的不是很多,有时候会认为MongoDB数据库对一些功能不支持,或者认为支持不好.今天我们 演示一下 MongoDB对“加减乘除”的使用. 在MongoDB数 ...

  2. C# Math的说有函数 以及说明

    Math.Abs(x)                                      x绝对值 Math.Acos(x)                                  ...

  3. kylin简单优化cube

    优化Cube 层次结构 理论上,对于N维,你最终会得到2 ^ N维组合.但是对于某些维度组,不需要创建这么多组合.例如,如果您有三个维度:洲,国家,城市(在层次结构中,“更大”维度首先出现).在深入分 ...

  4. MySQL:1366 - Incorrect string value错误解决办法

    今天使用navicat向MySQL中插入中文时,报错: - Incorrect string value:... 在我自己数据库设计之初,没有设计好字符编码格式的问题. 使用如下语句解决: alter ...

  5. Cs231n-assignment 2作业笔记

    assignment 2 assignment2讲解参见: https://blog.csdn.net/BigDataDigest/article/details/79286510 http://ww ...

  6. LV 指定或修改逻辑卷的major, minor号[RHEL6]

    在创建逻辑卷时,可以指定逻辑卷的major和minor设备号. [-M|--persistent {y|n}] //Set to y to make the minor number specifie ...

  7. web Deploy发布问题

    使用vs开发的时候,经常会发布项目.传统发布是登陆远程桌面.或ftp这些发布都有一定的麻烦.不能灵活的管理发布的文件.因此后来研究了web Deploy,研究之后发现是很不错的发布工具.这里把我使用w ...

  8. Ambari与Kerberos 集成

    Kerberos 介绍 Kerberos 是一个网络认证的框架协议,其设计的初衷便是通过密钥系统为 Client 和 Server 应用程序之间提供强大的认证服务.在使用 Kerberos 认证的集群 ...

  9. @FeignClient

    @FeignClient("APP-PROVIDER")public interface MyFeignClient { @RequestMapping(value = " ...

  10. 如何给python程序加密

    在实际的工作中,有时候我们需要部署自己的Python应用,但这时候我们并不希望别人能够看到自己的Python源程序.因此,我们需要为自己的源代码进行加密,Python已经为我们提供了这样一套工作机制. ...