全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
查看: 2236|回复: 15
打印 上一主题 下一主题

[疑问] DZ1.5的规则加到那个地方

[复制链接]
跳转到指定楼层
1#
发表于 2010-9-4 10:40:53 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
rewrite ^([^\.]*)/topic-(.+)\.html$ $1/portal.php?mod=topic&topic=$2 last;
rewrite ^([^\.]*)/article-([0-9]+)-([0-9]+)\.html$ $1/portal.php?mod=view&aid=$2&page=$3 last;
rewrite ^([^\.]*)/forum-(\w+)-([0-9]+)\.html$ $1/forum.php?mod=forumdisplay&fid=$2&page=$3 last;
rewrite ^([^\.]*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=viewthread&tid=$2&extra=page%3D$4&page=$3 last;
rewrite ^([^\.]*)/group-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=group&fid=$2&page=$3 last;
rewrite ^([^\.]*)/space-(username|uid)-(.+)\.html$ $1/home.php?mod=space&$2=$3 last;
rewrite ^([^\.]*)/([a-z]+)-(.+)\.html$ $1/$2.php?rewrite=$3 last;
if (!-e $request_filename) {
        return 404;
}



是不是加到usr/local/nginx/conf/nginx.conf里面的server里面啊
2#
发表于 2010-9-4 10:42:32 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
3#
发表于 2010-9-4 10:43:12 | 只看该作者
是的 加到server里
我也装了个玩
4#
 楼主| 发表于 2010-9-4 10:43:24 | 只看该作者
为什么我加了还是不行,也重启了
5#
发表于 2010-9-4 10:57:12 | 只看该作者
贴出来看看
6#
 楼主| 发表于 2010-9-4 10:57:58 | 只看该作者
user  www www;

worker_processes 1;

error_log  /home/wwwroot/logs/nginx_error.log  crit;

pid        /usr/local/nginx/logs/nginx.pid;

#Specifies the value for maximum file descriptors that can be opened by this process.
worker_rlimit_nofile 51200;

events
        {
                use epoll;
                worker_connections 51200;
        }

http
        {
               
        server_name_in_redirect off;
                include       mime.types;
                default_type  application/octet-stream;

                server_names_hash_bucket_size 128;
                client_header_buffer_size 32k;
                large_client_header_buffers 4 32k;
                client_max_body_size 8m;

                sendfile on;
                tcp_nopush     on;

                keepalive_timeout 60;

                tcp_nodelay on;

                fastcgi_connect_timeout 300;
                fastcgi_send_timeout 300;
                fastcgi_read_timeout 300;
                fastcgi_buffer_size 64k;
                fastcgi_buffers 4 64k;
                fastcgi_busy_buffers_size 128k;
                fastcgi_temp_file_write_size 256k;

                gzip on;
                gzip_min_length  1k;
                gzip_buffers     4 16k;
                gzip_http_version 1.0;
                gzip_comp_level 2;
                gzip_types       text/plain application/x-javascript text/css application/xml;
                gzip_vary on;

                #limit_zone  crawler  $binary_remote_addr  10m;

server
        {
RewriteEngine On
RewriteBase /
rewrite ^([^\.]*)/topic-(.+)\.html$ $1/portal.php?mod=topic&topic=$2 last;
rewrite ^([^\.]*)/article-([0-9]+)-([0-9]+)\.html$ $1/portal.php?mod=view&aid=$2&page=$3 last;
rewrite ^([^\.]*)/forum-(\w+)-([0-9]+)\.html$ $1/forum.php?mod=forumdisplay&fid=$2&page=$3 last;
rewrite ^([^\.]*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=viewthread&tid=$2&extra=page%3D$4&page=$3 last;
rewrite ^([^\.]*)/group-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=group&fid=$2&page=$3 last;
rewrite ^([^\.]*)/space-(username|uid)-(.+)\.html$ $1/home.php?mod=space&$2=$3 last;
rewrite ^([^\.]*)/([a-z]+)-(.+)\.html$ $1/$2.php?rewrite=$3 last;
if (!-e $request_filename) {
        return 404;
}


                listen       80;
                server_name www.xxxx.com;
                index index.html index.htm index.php;
                root  /home/wwwroot;

                location ~ .*\.(php|php5)?$
                        {
                                fastcgi_pass  unix:/tmp/php-cgi.sock;
                                fastcgi_index index.php;
                                include fcgi.conf;
                        }

                location /status {
                        stub_status on;
                        access_log   off;
                }

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

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

                log_format  access  '$remote_addr - $remote_user [$time_local] "$request" '
             '$status $body_bytes_sent "$http_referer" '
             '"$http_user_agent" $http_x_forwarded_for';
                access_log  /home/wwwroot/logs/access.log  access;
        }
include vhost/*.conf;
}
7#
发表于 2010-9-4 10:59:39 | 只看该作者
RewriteEngine On
RewriteBase /
是你自己加的?
8#
 楼主| 发表于 2010-9-4 11:02:46 | 只看该作者
原帖由 vaman 于 2010-9-4 10:59 发表
RewriteEngine On
RewriteBase /
是你自己加的?


是的,我去掉了也是不行的。
9#
发表于 2010-9-4 11:04:34 | 只看该作者
反正我的是行的
我是把规则直接存到vhost那里面直接include调用的
10#
 楼主| 发表于 2010-9-4 11:06:32 | 只看该作者
原帖由 vaman 于 2010-9-4 11:04 发表
反正我的是行的
我是把规则直接存到vhost那里面直接include调用的


写上你的步骤吧
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

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

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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