nginx 環境 thinkphp 隱藏index.php

tp官網已經寫了 http://doc.thinkphp.cn/manual/hidden_index.htmlphp

 

不生效 重啓nginx .問題依舊html

kill掉nginx進程  再啓動nginx

貼段本身的配置:thinkphp

server {
listen 80;
server_name url;
root /*/*/*;url

#include conf.d/ipFilter.conf;
#access_log /data/logs/$server_name.access.log main;spa

if ($http_user_agent ~ "DNSPod") {server

return 200;htm

}進程

try_files $uri $uri/ @rewrite;ip

#隱藏index.php

location / {

       if (!-e $request_filename) {

               rewrite ^(.*)$ /index.php?s=$1 last;
              break;

#pathinfo模式

location ~ \.php {

fastcgi_pass 127.0.0.1:9000;
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;
}

}

相關文章
相關標籤/搜索