久久久久久AV无码免费看大片,亚洲一区精品人人爽人人躁,国产成人片无码免费爱线观看,亚洲AV成人无码精品网站,为什么晚上搞的时候要盖被子

nginx開啟對偽靜態(tài)隱藏index.php的支持

時(shí)間:2017-06-21 23:34:12 類型:PHP
字號:    

最近看到人有說某個(gè)PHP框架不支持nginx, 這應(yīng)該是一個(gè)理解的錯(cuò)誤, 既然是PHP框架, 肯定是用PHP程序?qū)懙? 而nginx就是運(yùn)行PHP的WEB服務(wù)器, 所以, 只能說一些配置與apache來比, 有一些區(qū)別, 但絕對不會說某個(gè)框架在APACHE下OK, 但在nginx是不不行的

這里貼下nginx下對偽靜態(tài)的支持, 從而來隱藏index.php文件, 在nginx的配置文件或者加載的vhosts.conf文件里面增加

server {
        listen       80;
        server_name  ncdzsj.cn phpStudy.net;
        root   "D:/phpStudy/WWW/ncdzsj.cn";
        location / {
            index  index.html index.htm index.php;
            rewrite ^/$ /index.php last;  #增加這一行
            rewrite ^/(?!index\.php|robots\.txt|images|js|up|css)(.*)$ /index.php/$1 last;  #增加這一行
            #autoindex  on;
        }
        location ~ \.php(.*)$ {
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_split_path_info  ^((?U).+\.php)(/?.+)$;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            fastcgi_param  PATH_INFO  $fastcgi_path_info;
            fastcgi_param  PATH_TRANSLATED  $document_root$fastcgi_path_info;
            include        fastcgi_params;
        }
}