容器技术交流

 找回密码
 立即注册
查看: 3041|回复: 2

nginx下discuz7的rewrit问题。

[复制链接]
发表于 2009-8-2 08:57:12 | 显示全部楼层 |阅读模式
以下代码是在discuz找到的nginx下discuz7的代码。
  1. 这个是bbs的server

  2. {

  3. listen 80;

  4. server_name bbs.aiyobaby.com;

  5. index index.html index.htm index.php;

  6. root /home/aiyobaby/web/bbs;



  7. #limit_conn crawler 20;



  8. location ~ .*\.(php|php5)?$

  9. {

  10. #fastcgi_pass unix:/tmp/php-cgi.sock;

  11. fastcgi_pass 127.0.0.1:9000;

  12. fastcgi_index index.php;

  13. include fcgi.conf;

  14. }



  15. location / {

  16. rewrite ^/archiver/((fid|tid)-[\w\-]+\.html)$ /archiver/index.php?$1 last;

  17. rewrite ^/forum-([0-9]+)-([0-9]+)\.html$ /forumdisplay.php?fid=$1&page=$2 last;

  18. rewrite ^/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ /viewthread.php?tid=$1&extra=page%3D$3&page=$2 last;

  19. rewrite ^/space-(username|uid)-(.+)\.html$ /space.php?$1=$2 last;

  20. rewrite ^/tag-(.+)\.html$ /tag.php?name=$1 last;

  21. break;

  22. }
  23. 复制代码
复制代码
我在fawp后台nginx重新规则里加入(不加大括号也试过)伪静态一下不好使。。。域名是www.abc.com  测试论坛在http://www.abc.com/discuz7/这个规则要怎么写啊。
  1. {

  2. rewrite ^/archiver/((fid|tid)-[\w\-]+\.html)$ /archiver/index.php?$1 last;

  3. rewrite ^/forum-([0-9]+)-([0-9]+)\.html$ /forumdisplay.php?fid=$1&page=$2 last;

  4. rewrite ^/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ /viewthread.php?tid=$1&extra=page%3D$3&page=$2 last;

  5. rewrite ^/space-(username|uid)-(.+)\.html$ /space.php?$1=$2 last;

  6. rewrite ^/tag-(.+)\.html$ /tag.php?name=$1 last;

  7. break;

  8. }
复制代码
发表于 2009-8-2 09:46:06 | 显示全部楼层
把/改成/bbs/(/discuz7/)
 楼主| 发表于 2009-8-2 10:40:11 | 显示全部楼层
谢谢A。。。。。
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Archiver|URLOS ( 粤ICP备18087780号 )

GMT+8, 2025-5-8 05:52 , Processed in 0.028295 second(s), 18 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表