403エラーが発生するたびに、/ temp / www/error403.htmlにエラーページを表示しようとしています。
これは、ユーザーがhttps(ssl)経由でサイトにアクセスしようとし、そのIPがblovkips.confファイルにある場合に必ず発生しますが、現時点ではnginxのデフォルトのエラーページが表示されます。他のサーバーにも同じコードがあり(ブロックなし)、機能します。
IPがカスタム403ページにアクセスするのをブロックしていますか?もしそうなら、どうすればそれを機能させることができますか?
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;
}
編集: error_pageコードを504から403に修正しましたが、それでも同じ問題が発生します