Windows下Nginx的啟動停止等基本操作命令詳解
在Windows下使用Nginx,我們需要掌握一些基本的操作命令,比如:啟動、停止Nginx服務(wù),重新載入Nginx等,下面我就進(jìn)行一些簡單的介紹。
1、啟動:
C:\server\nginx-1.0.2>start nginx
或
C:\server\nginx-1.0.2>nginx.exe
注:建議使用第一種,第二種會使你的cmd窗口一直處于執(zhí)行中,不能進(jìn)行其他命令操作。
2、停止:
C:\server\nginx-1.0.2>nginx.exe -s stop
或
C:\server\nginx-1.0.2>nginx.exe -s quit
注:stop是快速停止nginx,可能并不保存相關(guān)信息;quit是完整有序的停止nginx,并保存相關(guān)信息。
3、重新載入Nginx:
C:\server\nginx-1.0.2>nginx.exe -s reload
當(dāng)配置信息修改,需要重新載入這些配置時使用此命令。
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不但顯示版本信息,還顯示配置參數(shù)信息。
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
本文介紹的這幾個命令都是非常基礎(chǔ)的,很空間記住,多嘗試幾次就可以了
相關(guān)文章
使用Nginx進(jìn)行URL轉(zhuǎn)發(fā)的配置案例
Nginx是一個高性能的Web服務(wù)器和反向代理服務(wù)器,它還可以用于URL轉(zhuǎn)發(fā),在本教學(xué)文章中,我們將從安裝Nginx開始,逐步介紹配置步驟,并展示一個URL轉(zhuǎn)發(fā)的案例,感興趣的朋友可以參考下2023-09-09
Nginx URL重寫rewrite機(jī)制原理及使用實(shí)例
這篇文章主要介紹了Nginx URL重寫(rewrite)機(jī)制原理及使用實(shí)例,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友可以參考下2020-08-08
Nginx緩存在服務(wù)端 代理和客戶端的區(qū)別深入探索
這篇文章主要介紹了Nginx緩存在服務(wù)端 代理和客戶端的區(qū)別深入探索,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪2023-10-10
Nginx實(shí)現(xiàn)基于請求頭的訪問控制配置的示例
在Nginx中,可以使用"allow"和"deny"指令來實(shí)現(xiàn)IP訪問限制,本文給大家介紹Nginx實(shí)現(xiàn)基于請求頭的訪問控制配置,感興趣的朋友一起看看吧2023-11-11
nginx使用replace-filter-nginx-module實(shí)現(xiàn)內(nèi)容替換的示例
本篇文章主要介紹了nginx使用replace-filter-nginx-module實(shí)現(xiàn)內(nèi)容替換的示例,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧2018-03-03
nginx proxy_set_header設(shè)置自定義header的實(shí)現(xiàn)步驟
在Nginx中,使用?proxy_set_header指令可以自定義header并在反向代理時傳遞到后端服務(wù)器,本文就來詳細(xì)的介紹一下,具有一定的參考價值,感興趣的可以了解一下2024-05-05

