找回密码
 立即注册
查看: 2227|回复: 6

URL重新显示404

[复制链接]

已分享文件:0个

网盘今日赚:积分

发表于 2011-8-8 20:40:14 | 显示全部楼层 |阅读模式
URL重写不知道是不是出现了错误 显示的是404页面
server
        {
                listen       80;
                server_name hawkdisk.com www.hawkdisk.com;
                index index.html index.htm index.php default.html default.htm default.php;
                root  /home/wwwroot/hawkdisk.com;

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

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

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

                log_format  hawk  '$remote_addr - $remote_user [$time_local] $request '
             '$status $body_bytes_sent $http_referer '
             '$http_user_agent $http_x_forwarded_for';
                access_log  /home/wwwlogs/hawk.log  hawk;
        }

能帮我解决下吗?

已分享文件:0个

网盘今日赚:积分

 楼主| 发表于 2011-8-9 12:58:29 | 显示全部楼层
没人管?

已分享文件:0个

网盘今日赚:积分

 楼主| 发表于 2011-8-10 23:21:30 | 显示全部楼层

已分享文件:20个

网盘今日赚:积分

发表于 2011-8-13 08:30:01 | 显示全部楼层
回复 hu5487 的帖子

你这个规则哪有重写在里面啊!

已分享文件:0个

网盘今日赚:积分

 楼主| 发表于 2011-8-22 21:37:48 | 显示全部楼层
回复 along 的帖子

www.hawkdisk.com.conf
server
        {
                listen       80;
                server_name www.hawkdisk.com hawkdisk.com;
                index index.html index.htm index.php default.html default.htm default.php;
                root  /home/wwwroot/www.hawkdisk.com;

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

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

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

                access_log off;
        }

hawk.conf
rewrite ^(.*)/file-([0-9]+)\.html$ $1/viewfile.php?file_id=$2 last;
rewrite ^(.*)/viewfile-([0-9]+)-([a-zA-Z0-9]*)\.html$ $1/downfile.php?action=view&file_id=$2&file_key=$3 last;
rewrite ^(.*)/downfile-([0-9]+)-([a-zA-Z0-9]*)\.html$ $1/downfile.php?file_id=$2&file_key=$3 last;
rewrite ^(.*)/space-(.+)\.html$ $1/space.php?username=$2 last;

已分享文件:0个

网盘今日赚:积分

 楼主| 发表于 2011-8-22 21:38:01 | 显示全部楼层
这样弄也不行

已分享文件:20个

网盘今日赚:积分

发表于 2011-8-23 09:01:53 | 显示全部楼层
需要放到server {} 中,具体请查看nginx的静态配置规则
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|PHPDisk系统交流社区 ( 粤ICP备10073657号 )

GMT+8, 2024-9-28 21:30 , Processed in 0.054222 second(s), 28 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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