全球主机交流论坛

标题: centos+nginx 怎么弄 DZ7.2的伪静态 [打印本页]

作者: xuexilinux    时间: 2010-1-24 21:16
标题: centos+nginx 怎么弄 DZ7.2的伪静态
RT
作者: cpuer    时间: 2010-1-24 21:17
标题: 回复 1# 的帖子
6.0.0的话我可以复制给你

Discuz 7.2的话就不清楚了。

nginx.conf 的server段里面加入。

Discuz6在nginx下的伪静态规则:http://fd.vvwvv.eu.org/thread-5576-1-1.html
作者: xuexilinux    时间: 2010-1-24 21:21
这个适用7.2么 加到Server哪里?
结尾还是哪里
作者: cpuer    时间: 2010-1-24 21:25
标题: 回复 3# 的帖子
是否适合Discuz 7.2我不清楚的,

比如一个discuz 6.0 伪静态成功的nginx server段,根目录放的论坛
server
        {
                listen       80;
                server_name www.test.com;
                index index.html index.htm index.php;
                root  /web/www;
                error_page 404 /404.html;
                #limit_conn   crawler  20;

                #location /status {
                #stub_status        on;
                #access_log        off;
                #}
                location / {
rewrite ^(.*)/archiver/((fid|tid)-[\w\-]+\.html)$ $1/archiver/index.php?$2 last;
rewrite ^(.*)/forum-([0-9]+)-([0-9]+)\.html$ $1/forumdisplay.php?fid=$2&page=$3 last;
rewrite ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ $1/viewthread.php?tid=$2&extra=page%3D$4&page=$3 last;
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;
}
                location ~ .*\.(php|php5)?$
                        {
                                fastcgi_pass  unix:/tmp/php-cgi.sock;
                                #fastcgi_pass  127.0.0.1:9000;
                                fastcgi_index index.php;
                                include fcgi.conf;
                                fastcgi_intercept_errors on;
                        }

                location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
                        {
                                expires      30d;
                        }

                location ~ .*\.(js|css)?$
                        {
                                expires      12h;
                        }

                log_format  test  '$remote_addr - $remote_user [$time_local] "$request" '
             '$status $body_bytes_sent "$http_referer" '
             '"$http_user_agent" $http_x_forwarded_for';
                access_log  /web/logs/access.log  access;
        }

作者: jker    时间: 2010-1-24 21:52
6和7.2通用的应该是
作者: cpuer    时间: 2010-1-24 21:53
标题: 回复 5# 的帖子
哦,那楼主可以去试试我给的。
作者: 炎羽    时间: 2010-1-24 21:56
当然,你可以先运行/etc/init.d/iptables stop
先看看能不能连上
作者: xuexilinux    时间: 2010-1-24 22:47
好了  首页可以静态么
作者: cpuer    时间: 2010-1-24 22:56
标题: 回复 8# 的帖子
首页不是index.php嘛,这个你还要静态呀   不行的呢。




欢迎光临 全球主机交流论坛 (https://fd.vvwvv.eu.org/) Powered by Discuz! X3.4