nginx的vhost配置

server {
    listen 80;

    server_name 127.0.0.1;

    root /home/wwwroot/test;
    index index.php index.html index.htm;
    
    location / {
          if (!-e $request_filename) {
                  rewrite ^/MP_verify_(.*)$ /index.php/WxCheck/$1 last;
             }  
    }    


    location ~ \.php {    #去掉$
         fastcgi_pass   127.0.0.1:9000;
         #fastcgi_pass  unix:/tmp/php-cgi.sock;
         fastcgi_index  index.php;
         fastcgi_split_path_info ^(.+\.php)(.*)$;     #增加這一句
         fastcgi_param PATH_INFO $fastcgi_path_info;    #增加這一句
         fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
         include        fastcgi_params;
    }

       
}

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章