1.下载:
http://nginx.org/download/nginx-1.8.0.zip
2.解压到:
D:/nginx-1.8.0
3.运行命令:
cd nginx
start nginx
访问127.0.0.1 ,就可以了。
常用命令:
nginx -s stop // 停止nginx
nginx -s reload // 重新加载配置文件 ,只能在运行时执行
nginx -s quit // 退出nginx
4.修改根目录:
location / {
root D:/html;
index index.html index.htm inde.php;
}
5.设置PHP支持
location ~ \.php$ {
root D:/html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}