IP deny is skipped when error page filename entered.
August 05, 2013 04:41AM
I'm using Nginx 1.4.2. In my location block I have:
deny all;
error_page 403 /403.html;
error_page 404 =301 http://www.redirect-domain.com;

In my server block I have:
location /403.html {root /var/test/; internal; allow all;}

Experience: When I visit my domain it gives me the custom 403 error page which is expected because my IP is blocked.

Issue: If i enter the URL of my custom 403 page (http://www.doman.com/403.html) then it bypasses the IP deny and redirects me to http://www.redirect-domain.com as if I am an allowed user. I plan to replace the 'deny all' with a list of bad IPs to prevent them from redirecting but if they enter http://www.doman.com/403.html then the IP block has no effect.

Is this a bug or am I configuring incorrectly? What I am trying to do is: Block all bad IPs with a custom error page. All good IPs are allowed to continue (which is this domain redirects users to my main domain). Everything works fine as long as the bad IP user does not enter the .html file in the url. I can always use a random filename to prevent anyone from guessing the html file but I would like to resolve the issue if possible.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 120
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready