我试图在发生403错误时在/temp/www/error403.html中显示错误页面.@H_301_2@
这应该是每当用户尝试通过https(ssl)访问该站点并且它的IP位于blovkips.conf文件中时,但此时它仍然显示Nginx的默认错误页面.
我有其他服务器相同的代码(没有任何阻止),它的工作原理.@H_301_2@
是否阻止IP访问自定义403页面?
如果是这样,我如何让它工作?@H_301_2@
@H_301_2@
server {
# ssl
listen 443;
ssl on;
ssl_certificate /etc/Nginx/ssl/site.in.crt;
ssl_certificate_key /etc/Nginx/ssl/site.in.key;
keepalive_timeout 70;
server_name localhost;
location / {
root /temp/www;
index index.html index.htm;
}
# redirect server error pages to the static page
error_page 403 /error403.html;
# location = /error403.html {
# root /temp/www;
# }
# add trailing slash if missing
if (-f $document_root/$host$uri) {
rewrite ^(.*[^/])$$1/ permanent;
}
# list of IPs to block
include blockips.conf;
}
最佳答案