全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

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

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

[复制链接]
跳转到指定楼层
1#
发表于 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 编辑 ]
2#
 楼主| 发表于 2010-12-23 09:14:07 | 只看该作者
3#
发表于 2010-12-23 09:27:41 | 只看该作者
空间速度不错。
4#
 楼主| 发表于 2010-12-23 11:48:51 | 只看该作者
知道是什么空间吗!
5#
发表于 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; 我是这要做的 伪静态没问题
6#
发表于 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-5-3 08:50 , Processed in 0.059355 second(s), 8 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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