VPS侦探论坛

 找回密码
 注册
查看: 10199|回复: 7

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

[复制链接]
发表于 2010-8-25 17:19:41 | 显示全部楼层 |阅读模式

看到很多网站404和403都是html的,这个应该怎么实现啊
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2010-8-25 22:51:52 | 显示全部楼层

回复 1# 的帖子



下面的帖子刚问了 ,搜索一下吧
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 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_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;
        }
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2010-8-26 09:51:08 | 显示全部楼层

回复 3# 的帖子




/usr/local/nginx/sbin/nginx -t 检查一下是否有错误。
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 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
没有错误

军哥运维代购:http://shop63846532.taobao.com/

发表于 2010-8-26 10:48:32 | 显示全部楼层

回复 5# 的帖子


先修改nginx.conf,在http段里面找到fastcgi_temp_file_write_size ,在下面添加一行,fastcgi_intercept_errors on;
再重启nginx试试
 楼主| 发表于 2010-8-26 11:19:56 | 显示全部楼层

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

403和404现实的都不是我自定义403,404里的内容
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2010-8-26 13:26:23 | 显示全部楼层

回复 7# 的帖子


用的ie吗?
自定义的404页面必须大于512字节,否则可能会出现IE默认的404页面
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-8 08:36 , Processed in 0.027822 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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