nigux 项目下如何隐藏index.php
配置你的域名 指向入口文件 例如w
ww.api.com/
然后在 ngiux-conf加入一下配置
#
www.api.com/
server{
listen 80;
#域名
server_name www.api.com;
default_type text/html;
#指向你的项目入口文件
root "F:\phpStudy\WWW\basic\web";
index index.php;
location / {
try_files $uri $uri/ /index.php?$query_string;
#try_files $uri $uri/ /index.php$is_args$args;
}
location ~ \.php$ {
try_files $uri =404;
include fastcgi_params;
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;
}
}
重启所有服务 成功