nginx thinkphp rewrite
Posted on 七月 22nd, 2011 by Jerry Jee
thinkphp设置:
‘URL_MODEL’=>2,
nginx.conf设置:
server
{
listen 80;
server_name jerryji.cn;
index index.html index.php;
root /data/htdocs/www/jerryji.cn;location / {
index index.html index.php;
try_files $uri $uri/ /index.php?s=$uri&$args; #主要是这里
}location ~ .*.(php)?$
{
fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_index index.php;
include fcgi.conf;
}location ~ .*.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}location ~ .*.(js|css)?$
{
expires 12h;
}access_log off;
}
Popularity: 2%