国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 網站 > Nginx > 正文

windows下nginx安裝、配置與使用

2024-08-30 12:21:48
字體:
來源:轉載
供稿:網友
本文主要介紹windows下nginx安裝、配置與使用的方法,講解的比較全面,需要的朋友可以參考一下。

  目前國內各大門戶網站已經部署了Nginx,如新浪、網易、騰訊等;國內幾個重要的視頻分享網站也部署了Nginx,如六房間、酷6等。新近發現Nginx 技術在國內日趨火熱,越來越多的網站開始部署Nginx。

    相比apeach、iis,nginx以輕量級、高性能、穩定、配置簡單、資源占用少等優勢廣受歡迎。

1)下載地址:

  http://nginx.org

2)啟動

  解壓至c:/nginx,運行nginx.exe(即nginx -c conf/nginx.conf),默認使用80端口,日志見文件夾C:/nginx/logs

3)使用

  http://localhost

4)關閉

  nginx -s stop 或taskkill /F /IM nginx.exe > nul

5)常用配置

   C:/nginx/conf/nginx.conf,使用自己定義的conf文件如my.conf,命令為nginx -c conf/my.conf

  常用配置如下:

復制代碼 代碼如下:Nginx.conf代碼
http {
 server {
 #1.偵聽80端口
 listen 80;
 location / {
 # 2. 默認主頁目錄在nginx安裝目錄的html子目錄。
 root html;
 index index.html index.htm;
 # 3. 沒有索引頁時,羅列文件和子目錄
 autoindex on;
 autoindex_exact_size on;
 autoindex_localtime on;
 }
 # 4.指定虛擬目錄
 location /tshirt {
 alias D:/programs/Apache2/htdocs/tshirt;
 index index.html index.htm;
 }
 }
 # 5.虛擬主機www.emb.info配置
 server {
 listen 80;
 server_name www.emb.info;
 access_log emb.info/logs/access.log;
 location / {
 index index.html;
 root emb.info/htdocs;
 }
 }
}

  
  小提示:
  運行nginx -V可以查看該Win32平臺編譯版支持哪些模塊。我這里的結果為:
  Log代碼

復制代碼 代碼如下:nginx version: nginx/0.7.65
TLS SNI support enabled
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-openssl=objs.msvc8/lib/openssl-0.9.8k
--with-openssl-opt=enable-tlsext
--with-zlib=objs.msvc8/lib/zlib-1.2.3
--with-select_module
--with-http_ssl_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

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 基隆市| 鄂托克前旗| 石河子市| 六盘水市| 辉南县| 年辖:市辖区| 宜丰县| 门源| 阿合奇县| 京山县| 岳阳市| 富民县| 永德县| 阿克苏市| 稻城县| 工布江达县| 文昌市| 临汾市| 临颍县| 迁安市| 舟山市| 荣昌县| 峨眉山市| 武隆县| 色达县| 乌鲁木齐市| 白玉县| 昭觉县| 南召县| 柘城县| 泸溪县| 嘉禾县| 赣州市| 龙南县| 延庆县| 岗巴县| 延吉市| 临猗县| 西青区| 巴彦淖尔市| 万载县|