ThinkSAAS Nginx 的偽靜態(Rewrite)規則

ThinkSAAS是一個輕量級的開源社區系統,是一個可以用來搭建討論組,bbs和圈子的社區系統。

江陰人就是采用的ThinkSAAS程序。

把下面代碼存為thinksaas.conf,然后在域名配置文件(jyr.me.conf)中嵌入(include thinksaas.conf)就行了。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
location /
{
    if (-f $request_filename/index.html)
    {
        rewrite (.*) $1/index.html break;
    }

    if (-f $request_filename/index.php)
    {
        rewrite (.*) $1/index.php;
    }

    if (!-f $request_filename)
    {
        rewrite (.*) /index.php;
    }
}