想要实现每个模块都有单独的入口文件, 但是在浏览器访问的时候还不要显示出来 module.php 这样的连接
```
# 目录结构
application/
admin/
api/
common/
index/
public/
index.php
admin.php
api.php
route.php
```
nginx配置文件修改
```
# index.php 的请求
location / {
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=$1 last;
break;
}
}
# admin 模块的请求,最好是修改名称
location /t-admin/ {
rewrite ^/t-admin/(.*)$ /admin.php?s=$1 last;
break;
}
# 同时支持 admin.php/test/test 这样的写法
location ~ \.php {
#fastcgi_pass remote_php_ip:9000;
fastcgi_pass unix:/dev/shm/php-cgi.sock;
fastcgi_index index.php;
include fastcgi_params;
set $real_script_name $fastcgi_script_name;
if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {
set $real_script_name $1;
set $path_info $2;
}
fastcgi_param SCRIPT_FILENAME $document_root$real_script_name;
fastcgi_param SCRIPT_NAME $real_script_name;
fastcgi_param PATH_INFO $path_info;
}
```