Nginx环境下supesite discuz wordpress静态化

前段时间购买了MediaTemple 的GS的主机,用的是大猫的优惠码,价格为160USD,用了几天时间发现问题多多,不是提示我内存超出限制就是连接被重置,无法正常使用,无奈,弃之……..

后来购买了跟showfom小朋友同一家的的美国VPS主机,用起来感觉不错,随机赠送2个独立IP.

在VPS上装的是口碑较好的 ,即LNMP. 但nginx下静态化规则与apache不同,需要重新配置,我目前用到的几款程序的静态化规则如下:wordpress 、supesite、discuz,nginx下静态化规则 ctrl+c +v following

//supesite nginx 静态化规则
rewrite ^/([0-9]+)/spacelist(.+)$ /index.php?uid/$1/action/spacelist/type$2 last;
rewrite ^/([0-9]+)/viewspace(.+)$ /index.php?uid/$1/action/viewspace/itemid$2 last;
rewrite ^/([0-9]+)/viewbbs(.+)$ /index.php?uid/$1/action/viewbbs/tid$2 last;
rewrite ^/([0-9]+)/(.*)$ /index.php?uid/$1/$2 last;
rewrite ^/([0-9]+)$ /index.php?uid/$1 last;
rewrite ^/action(.+)$ /index.php?action$1 last;
rewrite ^/category(.+)$ /index.php?action/category/catid$1 last;
rewrite ^/viewnews(.+)$ /index.php?action/viewnews/itemid$1 last;
rewrite ^/viewthread(.+)$ /index.php?action/viewthread/tid$1 last;
rewrite ^/mygroup(.+)$ /index.php?action/mygroup/gid$1 last;

//discuz  nginx 静态化规则

rewrite ^/archiver/((fid|tid)-[\w\-]+\.html)$ /archiver/index.php?$1 last;
rewrite ^/forum-([0-9]+)-([0-9]+)\.html$ /forumdisplay.php?fid=$1&page=$2 last;
rewrite ^/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ /viewthread.php?tid=$1&extra=page%3D$3&page=$2 last;
rewrite ^/space-(username|uid)-(.+)\.html$ /space.php?$1=$2 last;
rewrite ^/tag-(.+)\.html$ /tag.php?name=$1 last;
break;

//wordpress nginx 静态化规则
location / {
index index.html index.php;
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;
}
}

现在本博客于一小时前也已经搬迁到此款VPS上来了,大家感觉下速度如何?

PS.上次看完《建国大业》生病高烧一直到现在才好些,发烧必须到北京指定医院就诊,还要验血,还好,验完之后,一切正常!顺利回家,哈哈……

57 Responses to “Nginx环境下supesite discuz wordpress静态化”

  1. kangzj CHINA Mozilla Firefox Windows says:

    rewrite不兼容确实很麻烦
    上回为了写一个规则弄了一整天

    [Reply]

    久酷 CHINA Mozilla Firefox Windows Reply:

    @kangzj, 这东西写起来非常麻烦 ……..都是些符号,错一个也不行.

    [Reply]

  2. 卢松松 CHINA Mozilla Firefox Windows says:

    还好你没事,现在检查都是自费的吧?

    [Reply]

    久酷 CHINA Mozilla Firefox Windows Reply:

    @卢松松, 嗯,是自费的哇……一次要四百多啊.

    [Reply]

  3. Showfom CHINA Mozilla Firefox Windows says:

    WordPress 不用那么麻烦的 一行就可以 囧

    [Reply]

    久酷 CHINA Mozilla Firefox Windows Reply:

    @Showfom, 啥代码?发来学习学习…….

    [Reply]

    Showfom CHINA Mozilla Firefox Windows Reply:

    @久酷, http://zou.lu/wordpress-permalink/

    [Reply]

    久酷 CHINA Mozilla Firefox Windows Reply:

    @Showfom, 数了一下,一共是五行……..哈哈 :lol: :lol:

    Showfom CHINA Mozilla Firefox Windows Reply:

    @久酷, 可以连起来写一行 哈哈

  4. 胡一刀 CHINA Opera Windows says:

    ”加载时间0.486 秒“供久酷参考

    [Reply]

    久酷 CHINA Mozilla Firefox Windows Reply:

    @胡一刀, :lol: :lol: 收到

    [Reply]

  5. sleepy CHINA Google Chrome Windows says:

    为什么我打开的时候很慢,绿色的主题,蛮清爽的

    [Reply]

    久酷 CHINA Mozilla Firefox Windows Reply:

    @sleepy, 奇怪,的确,有时快,有时慢,刚碰到慢的了,正在研究 :lol: :lol:

    [Reply]

  6. Lc. CHINA Internet Explorer Windows says:

    没说啥主机?价格?
    呵呵。我感兴趣

    [Reply]

    久酷 CHINA Mozilla Firefox Windows Reply:

    @Lc., http://www.photonvps.com 价格在网站标明着 :lol: :lol: 几十G空间,几百至TB级流量吧^_^

    [Reply]

  7. 万戈 CHINA Mozilla Firefox Windows says:

    已经不能再快了 :lol:

    [Reply]

    久酷 CHINA Mozilla Firefox Windows Reply:

    @万戈, 哈哈,只要不比以前慢就好了 :lol: :lol:

    [Reply]

  8. 会律博客 CHINA Mozilla Firefox Windows says:

    深夜别整了,会更严重的!

    [Reply]

    久酷 CHINA Mozilla Firefox Windows Reply:

    @会律博客, 一好点就想折腾 :lol: :lol:

    [Reply]

  9. T CHINA Mozilla Firefox Ubuntu Linux says:

    靠,沙发没了。。

    p.s : 你挺喜欢搬家的啊,呵呵。

    [Reply]

    久酷 CHINA Mozilla Firefox Windows Reply:

    @T, 有好的就想搬啊. :lol: :lol:

    [Reply]

  10. MuMu‘S CHINA Safari Mac OS says:

    哇一一,抢个沙发做起。你满屏的Warning噢

    [Reply]

    久酷 CHINA Mozilla Firefox Windows Reply:

    @MuMu‘S, 哈哈……刚我也发现了,刚在配置服务器……..现在应该没问题了吧? :lol: :lol: :lol:

    [Reply]

    MuMu‘S CHINA Safari Mac OS Reply:

    @久酷, 现在好了。你的页面看起清爽就是舒服。 :mrgreen:

    [Reply]

    whisperer CHINA Internet Explorer Windows Reply:

    插入~~~ :mrgreen:

    [Reply]

Leave a Reply

:wink: :-| :-x :twisted: :) 8-O :( :roll: :-P :oops: :-o :mrgreen: :lol: :idea: :-D :evil: :cry: 8) :arrow: :-? :?: :!:


正在读取数据……