server
{
listen 80;
server_name xx.com;
index index.html index.php;
root /www/xx.com;

location /
{
index index.php;
if (!-e $request_filename) {
#多入口这几行也不需要
#rewrite /admin.php(.*)$ /admin.php$1 last;
#rewrite ^(.*)$ /index.php/$1;
#break;
rewrite ^/(.*)$ /index.php?s=$1 last;
}
}
location ~ [^/]\.php(/|$)
{
# comment try_files $uri =404; to enable pathinfo
#try_files $uri =404;
fastcgi_pass unix:/tmp/php-cgi5.6.sock;
fastcgi_index index.php;
include fastcgi.conf;
#注意pathinfo.conf不需要
#include pathinfo.conf;
}

location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}

location ~ .*\.(js|css)?$
{
expires 12h;
}

access_log off;
}

Comments are closed.

Post Navigation