nginx配置403错误页面

时间:2014-05-08 16:42:09   收藏:0   阅读:541

建立403 error 页面, 403.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head><title>Error 403</title></head>
<body>
<b><font size=5>Sorry!</font></b>
<p> <b>403 reject access</b> . 
<p><b>Please contact administrator zrer90.</b> 
<p><b>Think you.</b>
</body>
</html>

                        #不加<!DOCTYPE> 描述的话, IE浏览器只显示nginx默认403页面

修改nginx.conf

    server {
        listen       80;
        server_name  localhost;
        error_page 403 /403.html;
        access_log  logs/test.access.log  main;
        root /home/test/;
        index   index.html;
        }      

测试访问:

bubuko.com,布布扣

nginx配置403错误页面,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!