Windows下Nginx的啟動、停止等基本命令

來源:互聯網
上載者:User

標籤:link   quit   建議   儲存   select   msvc   enable   window   path   

在Windows下使用Nginx,我們需要掌握一些基本的操作命令,比如:啟動、停止Nginx服務,重新載入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的啟動、停止等基本命令

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.