全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
查看: 3399|回复: 5

[nginx] 帅哥美女~来看看我的什么代码错了~开启不到伪静态啊~

[复制链接]
发表于 2010-12-23 08:43:28 | 显示全部楼层 |阅读模式
user  www www;
worker_processes 8;
error_log  /home/www/logs/nginx_error.log  crit;
pid        /usr/local/nginx/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 1024;
        }
http
        {
                include       mime.types;
                default_type  application/octet-stream;
                #charse  gb2312;
                server_names_hash_bucket_size 128;
                client_header_buffer_size 128k;
                large_client_header_buffers 4 256k;
                client_max_body_size 16m;
                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 128k;

                gzip on;
                gzip_min_length  1k;
                gzip_buffers     4 16k;
                gzip_http_version 1.1;
                gzip_comp_level 9;
                gzip_types       text/plain application/x-javascript text/css application/xml;
                gzip_vary on;
                output_buffers   4 32k;
                postpone_output  1460;

                #limit_zone  crawler  $binary_remote_addr  10m;       
               
server
        {
                listen       80;
                server_name  *****.*** www.***.*** ***.***.** ***..*** 188.**.**.**;
                index index.php;
                include location.conf;
                root  /home/www;

                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 ^([^\.]*)/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;
}

DiscuzX1.5的

文件啊~
http://188.95.51.66/nginx.conf

[ 本帖最后由 calido 于 2010-12-23 09:12 编辑 ]
 楼主| 发表于 2010-12-23 09:14:07 | 显示全部楼层
发表于 2010-12-23 09:27:41 | 显示全部楼层
空间速度不错。
 楼主| 发表于 2010-12-23 11:48:51 | 显示全部楼层
知道是什么空间吗!
发表于 2010-12-23 12:11:29 | 显示全部楼层
  1. rewrite ^([^\.]*)/topic-(.+)\.html$ $1/portal.php?mod=topic&topic=$2 last;
  2. rewrite ^([^\.]*)/article-([0-9]+)-([0-9]+)\.html$ $1/portal.php?mod=view&aid=$2&page=$3 last;
  3. rewrite ^([^\.]*)/forum-(\w+)-([0-9]+)\.html$ $1/forum.php?mod=forumdisplay&fid=$2&page=$3 last;
  4. rewrite ^([^\.]*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=viewthread&tid=$2&extra=page%3D$4&page=$3 last;
  5. rewrite ^([^\.]*)/group-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=group&fid=$2&page=$3 last;
  6. rewrite ^([^\.]*)/space-(username|uid)-(.+)\.html$ $1/home.php?mod=space&$2=$3 last;
  7. rewrite ^([^\.]*)/([a-z]+)-(.+)\.html$ $1/$2.php?rewrite=$3 last;
  8. if (!-e $request_filename) {
  9.         return 404;
  10. }
复制代码
保存为discuzx.conf include discuzx.conf; 我是这要做的 伪静态没问题
发表于 2010-12-23 13:51:36 | 显示全部楼层
  1. rewrite ^([^\.]*)/topic-(.+)\.html$ $1/portal.php?mod=topic&topic=$2 last;
  2. rewrite ^([^\.]*)/article-([0-9]+)-([0-9]+)\.html$ $1/portal.php?mod=view&aid=$2&page=$3 last;
  3. rewrite ^([^\.]*)/forum-(\w+)-([0-9]+)\.html$ $1/forum.php?mod=forumdisplay&fid=$2&page=$3 last;
  4. rewrite ^([^\.]*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=viewthread&tid=$2&extra=page%3D$4&page=$3 last;
  5. rewrite ^([^\.]*)/group-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=group&fid=$2&page=$3 last;
  6. rewrite ^([^\.]*)/space-(username|uid)-(.+)\.html$ $1/home.php?mod=space&$2=$3 last;
  7. rewrite ^([^\.]*)/([a-z]+)-(.+)\.html$ $1/$2.php?rewrite=$3 last;
  8. if (!-e $request_filename) {
  9.         return 404;
  10. }
复制代码
这样加,我95%的客户安装的 DZX
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-11-27 02:13 , Processed in 0.067539 second(s), 9 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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