ngnix站内配置伪静态

来源:互联网 发布:手机mac addr 编辑:程序博客网 时间:2024/06/18 04:55
server {
        listen       80;
        server_name  www.haojieshao.net ;
index index.html index.htm index.php;
root /alidata/www/haojieshao/;
location ~ .*\.(php|php5)?$
{
#fastcgi_pass  unix:/tmp/php-cgi.sock;
fastcgi_pass  127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi.conf;
}
//添加这块
location / 
         { 
 if (!-e $request_filename) 

rewrite  ^(.*)$  /index.php?s=$1  last; 
break;   
 } 
}
//添加这块END
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 3d;
}
location ~ .*\.(js|css)?$
{
expires 3h;
}

}

主要是添加这块,就可以站内配置伪静态了。

0 0
原创粉丝点击