hu5487 发表于 2011-8-8 20:40:14

URL重新显示404

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_passunix:/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_formathawk'$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.loghawk;
        }

能帮我解决下吗?

hu5487 发表于 2011-8-9 12:58:29

没人管?:L

hu5487 发表于 2011-8-10 23:21:30

:@:@:@:@:@:@

along 发表于 2011-8-13 08:30:01

回复 hu5487 的帖子

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

hu5487 发表于 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_passunix:/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-(+)\.html$ $1/viewfile.php?file_id=$2 last;
rewrite ^(.*)/viewfile-(+)-(*)\.html$ $1/downfile.php?action=view&file_id=$2&file_key=$3 last;
rewrite ^(.*)/downfile-(+)-(*)\.html$ $1/downfile.php?file_id=$2&file_key=$3 last;
rewrite ^(.*)/space-(.+)\.html$ $1/space.php?username=$2 last;

hu5487 发表于 2011-8-22 21:38:01

这样弄也不行

along 发表于 2011-8-23 09:01:53

需要放到server {} 中,具体请查看nginx的静态配置规则
页: [1]
查看完整版本: URL重新显示404