www.xxx.com/模块/控制器/操作  这样是我现在的,不能打开
www.xxx.com/index.php/模块/控制器/操作  加上入口文件后可以正常打开
网上搜了说是服务器不支持pathinfo 
请问该怎么修改配置
nginx

解决方案 »

  1.   


    server {
            listen       80;
            server_name  XXXXXXXXXX ;
            root   "XXXXXXXXXX";
            location / {
                index  index.html index.htm index.php;
                #autoindex  on;
                
                if (!-e $request_filename) {
                  rewrite ^(.*)$ /index.php/$1 last;
                  break;
                }
                
            }
            location ~ \.php(.*)$ {
                fastcgi_pass   127.0.0.1:9000;
                fastcgi_index  index.php;            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
                fastcgi_param  PATH_INFO $1;
                include        fastcgi_params;
            }
    }
      

  2.   

    server{  
        listen 80;  
        server_name www.demo2.com; #绑定域名  
        location / {  
                root   /data/html/demo2;  
                index  index.php index.html index.htm;  
            }  
            location ~ \.php$ {  
                root           /data/html/demo1;  
                fastcgi_pass   127.0.0.1:9000;  
                fastcgi_index  index.php;  
                #fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;  
            fastcgi_param  SCRIPT_FILENAME  /data/html/demo2$fastcgi_script_name;  
                include        fastcgi_params;  
            }