error 403

I block or deny access based on the host name or IP address of the client visiting website under nginx web server. I want to display customized e403.html error page, but it doesn’t appear to be working. Nginx always displays the built-in, hardcoded “403 Forbidden” error message. Here is my configuration:

.....
  ...
 deny 1.2.3.4;
 deny 91.212.45.0/24;
 deny 91.212.65.0/24;
 .....
 ...
 error_page 403 /e403.html;
        location = /e403.html {
           root   html;
       }

How do I fix this problem and display custom error 403 page under nginx server?

{ 1 comment }

How do I block or deny access based on the host name or IP address of the client visiting website under nginx web server?

{ 13 comments }