首页 > 代码库 > nginx(安装)

nginx(安装)

    nginx 1.7.7, windows 8.1 x64


    官网: http://nginx.org/    官方文档: http://nginx.org/en/docs/ 

    再加一个,搜索时看到还不错的网站 http://www.nginx.cn/ 

    nginx [engine x] is an HTTP and reverse proxy server, as well as a mail proxy server, written by Igor Sysoev. 

    windows 直接下载,解压 即可运行。

    解压之后

D:\NGINX
├─ nginx.exe # 貌似windows tree 不显示文件
├─conf
├─contrib
│  ├─unicode2nginx
│  └─vim
│      ├─ftdetect
│      ├─indent
│      └─syntax
├─docs
├─html
├─logs
└─temp
    ├─client_body_temp
    ├─fastcgi_temp
    ├─proxy_temp
    ├─scgi_temp
    └─uwsgi_temp

    然后在cmd或PowerShell(最好在cmd中)中,切换到相应的根目录。也一定不要在path 中添加nginx.exe 。否则可能会造成你在其它位置启动nginx,但是nginx会在当前目录下面寻找 conf配置文件夹以及配置文件。所以最好的办法就是,直接切换到相应目录。


    基本命令:

> start nginx #启动nginx
> nginx.exe -s stop # 停止服务
> nginx.exe -s quit # 中止服务
> nginx.exe -s reload # 重新载入

# 其他
> nginx -v # 显示版本信息 
> nginx -V # 显示版本及配置信息


    正常情况下,启动完 nginx 之后,就能在进程中看到 2个 nginx 进程。访问 127.0.0.1(localhost) 即可看到 nginx 欢迎界面。

nginx(安装)