全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

IP归属甄别会员请立即修改密码
12
返回列表 发新帖
楼主: 遍地阳光
打印 上一主题 下一主题

discuz6在nginx下的伪静态规则是?

[复制链接]
11#
发表于 2010-3-27 09:01:47 | 只看该作者
/usr/local/nginx/conf/nginx.conf  这个文件 一般位置是在这的
下面的代码可以加在里面或替换掉历练的server段。加的话加在最后一个 } 的上面
我是这样加的
server
  {
    listen       80;
    server_name  域名.com;
    index index.html index.htm index.php;
    root  /home/www/bbs;

    location ~ .*\.(php|php5)?$
    {      
      #fastcgi_pass  unix:/tmp/php-cgi.sock;
      fastcgi_pass  127.0.0.1:9000;
      fastcgi_index index.php;
      include fcgi.conf;
    }
   location / {
            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;
        }
  location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$

   {

    expires      30d;

   }

  location ~ .*\.(js|css)?$

   {

    expires      12h;

   }

  access_log   off;

}

评分

参与人数 1威望 +30 收起 理由
cpuer + 30 感谢分享

查看全部评分

12#
发表于 2010-3-27 09:40:01 | 只看该作者

回复 13# 的帖子

13#
发表于 2010-3-27 16:40:12 | 只看该作者
谢谢以上几位。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2025-11-12 10:05 , Processed in 0.094416 second(s), 10 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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