polar 发表于 2010-7-15 18:13:00

军哥的LNMP 默认NGINX静态规则用不了。

安装了军哥的LNMP 然后添加了WORDPRESS DISCUZ默认的规则,但是无法访问。。




location / {
            rewrite ^/archiver/((fid|tid)-[\w\-]+\.html)$ /archiver/index.php?$1 last;
            rewrite ^/forum-(+)-(+)\.html$ /forumdisplay.php?fid=$1&page=$2 last;
            rewrite ^/thread-(+)-(+)-(+)\.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;
      }



求解

licess 发表于 2010-7-15 18:52:35

回复 1# 的帖子

贴虚拟主机配置

5566 发表于 2010-7-15 19:30:23

剛剛我也發生一樣的事情
由於我是放在 二級網址下 www.xxxx.org/bbs/
所以改了一下
location /bbs/
但此時又怪怪的 還是出現 404 = =
於是在將 下方的rewrite寫法改寫一下

變成   location /bbs/ {
rewrite ^(.*)/archiver/((fid|tid)-+.html)$ $1/archiver/index.php?$2 last;
rewrite ^(.*)/forum-(+)-(+).html$ $1/forumdisplay.php?fid=$2&page=$3 l$
rewrite ^(.*)/thread-(+)-(+)-(+).html$ $1/viewthread.php?tid=$2&e$
rewrite ^(.*)/profile-(username|uid)-(.+).html$ $1/viewpro.php?$2=$3 last;
rewrite ^(.*)/space-(username|uid)-(.+).html$ $1/space.php?$2=$3 last;
rewrite ^(.*)/tag-(.+).html$ $1/tag.php?name=$2 last;
      }

licess 发表于 2010-7-15 20:11:03

回复 3# 的帖子

重启nginx
页: [1]
查看完整版本: 军哥的LNMP 默认NGINX静态规则用不了。