日期:2014-05-16 浏览次数:20918 次
@echo off echo Starting PHP FastCGI... RunHiddenConsole.exe D:\server\php\php-cgi.exe -b 127.0.0.1:9000 -c D:\server\php\php.ini
server {
        listen       80;
        server_name  localhost;
        #charset koi8-r;
	#=====文字编码
        #access_log  logs/host.access.log  main;
        location / {
            #root   html;  #这个是默认使用的路径,也就是nginx目录中的文件夹
            root D:\server\www;  #我指向到了其他目录
            #是否禁止列出目录
            autoindex on;
        #Nginx目录自动加斜线:
        if (-d $request_filename){ 
            rewrite ^/(.*)([^/])$ http://$host/$1$2/ permanent; 
        } 
            index  index.html index.htm index.php;
        }
        #error_page  404              /404.html;
        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root html;
        }
        location ~ \.php$ {
            root	 d:\server\www;   #对于php文件的解析 要和上面的root同级否则会有问题
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME d:\server\www\$fastcgi_script_name;
            include        fastcgi_params;
        }
}
@echo off echo Stopping nginx... taskkill /F /IM nginx.exe >nul echo Stopping PHP FastCGI... taskkill /F /IM php-cgi.exe >nul exit