怎么在Windows中使用命令启动或停止Nginx

发布时间:2021-03-15 17:04:09 作者:Leah
来源:亿速云 阅读:456

本篇文章给大家分享的是有关怎么在Windows中使用命令启动或停止Nginx,小编觉得挺实用的,因此分享给大家学习,希望大家阅读完这篇文章后可以有所收获,话不多说,跟着小编一起来看看吧。

1、启动:

C:\server\nginx-1.0.2>start nginx

C:\server\nginx-1.0.2>nginx.exe

注:建议使用第一种,第二种会使你的cmd窗口一直处于执行中,不能进行其他命令操作。

2、停止:

C:\server\nginx-1.0.2>nginx.exe -s stop

C:\server\nginx-1.0.2>nginx.exe -s quit

注:stop是快速停止nginx,可能并不保存相关信息;quit是完整有序的停止nginx,并保存相关信息。

3、重新载入Nginx:

C:\server\nginx-1.0.2>nginx.exe -s reload

当配置信息修改,需要重新载入这些配置时使用此命令。

4、重新打开日志文件:

C:\server\nginx-1.0.2>nginx.exe -s reopen

5、查看Nginx版本:

C:\server\nginx-1.0.2>nginx -v

nginx: nginx version: nginx/1.0.2

C:\server\nginx-1.0.2>nginx -V

nginx: nginx version: nginx/1.0.2 
nginx: TLS SNI support enabled 
nginx: configure arguments: --builddir=objs.msvc8 --crossbuild=win32 --with-debug --prefix= --conf-path=conf/nginx.conf --pid-path=logs/nginx.pid --http-log-path=logs/access.log --error-log-path=logs/error.log --sbin-path=nginx.exe --http-client-body-temp-path=temp/client_body_temp --http-proxy-temp-path=temp/proxy_temp --http-fastcgi-temp-path=temp/fastcgi_temp --with-cc-opt=-DFD_SETSIZE=1024 --with-pcre=objs.msvc8/lib/pcre-7.9 --with-zlib=objs.msvc8/lib/zlib-1.2.3 --with-select_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_stub_status_module --with-http_flv_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-mail --with-ipv6 --with-openssl=objs.msvc8/lib/openssl-0.9.8r --with-openssl-opt=enable-tlsext --with-http_ssl_module --with-mail_ssl_module

注:v只是简单显示版本信息,V不但显示版本信息,还显示配置参数信息。

6、测试或载入指定配置文件:

测试配置文件

C:\server\nginx-1.0.2>nginx.exe -t -c conf/default.conf

nginx: the configuration file C:\server\nginx-1.0.2/conf/default.conf syntax isok
nginx: configuration file C:\server\nginx-1.0.2/conf/default.conf test is successful

载入指定配置文件

C:\server\nginx-1.0.2>start nginx.exe -c conf/default.conf

以上就是怎么在Windows中使用命令启动或停止Nginx,小编相信有部分知识点可能是我们日常工作会见到或用到的。希望你能通过这篇文章学到更多知识。更多详情敬请关注亿速云行业资讯频道。

推荐阅读:
  1. MYSQL 服务命令的启动与停止
  2. 启动、停止、删除windows服务的DOS命令

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

windows nginx

上一篇:怎么在Linux中使用crontab定时执行任务

下一篇:怎么在Linux中使用sshd服务

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》