首页 > 代码库 > nginx 隐藏index.php 路径path化
nginx 隐藏index.php 路径path化
server {
listen 80 default;
server_name _;
index index.html index.htm index.php;
#root /alidata/www/default;
root /alidata/www/sandbox_pro/sandbox;
#rewrite ^/box/list /index.php?r=box/list ;
#rewrite ^/(.*)$ /index.php?r=$1 ;
if ( -f $request_filename/index.php) {
rewrite (.*) $1/index.php;
}
if ( !-f $request_filename ) {
rewrite (.*) /index.php;
}
location ~ .*\.(php|php5)?$
{
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 1h;
}
nginx 隐藏index.php 路径path化