建立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;
}
测试访问:
原文地址:http://zrer90.blog.51cto.com/8679896/1408290