蜜桃精品成人影片,99国产精品偷窥熟女精品视频,啊灬啊灬啊灬快灬A片免费,b站大全永不收费免费下载软件吗,重囗味sM在线观看无码

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

時間:2017-06-21 23:34:12 類型:PHP
字號:    

最近看到人有說某個PHP框架不支持nginx, 這應該是一個理解的錯誤, 既然是PHP框架, 肯定是用PHP程序寫的, 而nginx就是運行PHP的WEB服務器, 所以, 只能說一些配置與apache來比, 有一些區(qū)別, 但絕對不會說某個框架在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;
        }
}