alex 发表于 2010-8-25 17:19:41

军哥404和403可以用html吗,具体应该怎么用

看到很多网站404和403都是html的,这个应该怎么实现啊

licess 发表于 2010-8-25 22:51:52

回复 1# 的帖子

下面的帖子刚问了:L ,搜索一下吧

alex 发表于 2010-8-26 09:35:15

添加后,重启后不管用啊,我把403.html和404.html放在网站的根目录
server
        {
                listen       80;
                server_name alex11.3322.org;
                index index.html index.htm index.php default.html default.htm default.php;
                root/home/wwwroot/bbs;
                                           error_page 404 /404.html;
                                           error_page 403 /403.html;

                include discuz.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;
        }

licess 发表于 2010-8-26 09:51:08

回复 3# 的帖子

/usr/local/nginx/sbin/nginx -t 检查一下是否有错误。

alex 发表于 2010-8-26 09:55:33

the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
configuration file /usr/local/nginx/conf/nginx.conf test is successful
没有错误:(

licess 发表于 2010-8-26 10:48:32

回复 5# 的帖子

先修改nginx.conf,在http段里面找到fastcgi_temp_file_write_size ,在下面添加一行,fastcgi_intercept_errors on;
再重启nginx试试

alex 发表于 2010-8-26 11:19:56

按照军哥的添加后,显示404是
找不到网页
您要查看的网页可能已被删除、名称已被更改,或者暂时不可用。
403显示是
您无权查看该网页
您可能没有权限用您提供的凭据查看此目录或网页。

403和404现实的都不是我自定义403,404里的内容

licess 发表于 2010-8-26 13:26:23

回复 7# 的帖子

用的ie吗?
自定义的404页面必须大于512字节,否则可能会出现IE默认的404页面
页: [1]
查看完整版本: 军哥404和403可以用html吗,具体应该怎么用