windows 下nginx配置

来源:互联网 发布:windows 2008 r2 安装 编辑:程序博客网 时间:2024/05/18 11:37

1.下载:

http://nginx.org/download/nginx-1.8.0.zip

2.解压到:

D:/nginx-1.8.0

3.运行命令:

cd nginxstart nginx

访问127.0.0.1 ,就可以了。

常用命令:

nginx -s stop          // 停止nginxnginx -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;        }


0 0
原创粉丝点击