Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[INSTALLATION] Whitelist Issue #539

Open
killmasta93 opened this issue Nov 13, 2023 · 2 comments
Open

[INSTALLATION] Whitelist Issue #539

killmasta93 opened this issue Nov 13, 2023 · 2 comments

Comments

@killmasta93
Copy link

Hi
Currently getting an issue when i try to whitelist an IP
doing a test with the example config

i added in the whitelist part

root@hera:/etc/nginx/bots.d# cat whitelist-ips.conf
# EDIT THIS FILE AS YOU LIKE TO WHITELIST ALL YOUR IP ADDRESSES AND IP RANGES ###

# VERSION INFORMATION #
#----------------------
# Version: V4.2019.05
# Updated: 2019-06-28
#----------------------
# VERSION INFORMATION #

##############################################################################
#       _  __     _                                                          #
#      / |/ /__ _(_)__ __ __                                                 #
#     /    / _ `/ / _ \\ \ /                                                 #
#    /_/|_/\_, /_/_//_/_\_\                                                  #
#       __/___/      __   ___       __     ___  __         __                #
#      / _ )___ ____/ /  / _ )___  / /_   / _ )/ /__  ____/ /_____ ____      #
#     / _  / _ `/ _  /  / _  / _ \/ __/  / _  / / _ \/ __/  '_/ -_) __/      #
#    /____/\_,_/\_,_/  /____/\___/\__/  /____/_/\___/\__/_/\_\\__/_/         #
#                                                                            #
##############################################################################

# Add One Entry Per Line - List all your IP's and IP Ranges you want to whitelist
# This file must exist on your system or Nginx will fail a reload due to a missing file
# Automatic updates will never be able to remove this custom list of yours
# Add One Entry Per Line as per the example
# Only add actual IP addresses and ranges here

# BY DEFAULT ALL THE EXAMPLES BELOW ARE COMMENTED OUT AND HENCE NOT ENABLED
# REFRAIN FROM USING 127.0.0.1 AS IT MAY CAUSE UNDESIRABLE RESULTS ON SOME SYSTEMS
# ---------
# EXAMPLES:
# ---------
	111.111.111.111		0;

# ------------
# MY WHITELIST
# ------------


# ------
# NOTES:
# ------
# - This file rules over any other other parts of the IP blocking.
# - If you blacklisted your own IP in blacklist-ips.conf whitelisting it here will over-ride the blacklisting.
# - Whitelisting IP's and RANGES here ONLY affects the IP blocking functions.
# - This file will NOT allow your own IP to bypass bad User-Agent or Referrer String checks.
# - To bypass everything for a certain IP see notes in blockbots.conf on SUPER WHITELIST

then added this part to the default.conf


  ##
    # Nginx Bad Bot Blocker Includes
    # REPO: https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker
    ##
        include /etc/nginx/bots.d/ddos.conf;
        include /etc/nginx/bots.d/blockbots.conf;
        include /etc/nginx/bots.d/whitelist-ips.conf;

getting this error


nginx: [emerg] unknown directive "111.111.111.111" in /etc/nginx/bots.d/whitelist-ips.conf:33
nginx: configuration file /etc/nginx/nginx.conf test failed

Thank you

@KeiroD
Copy link

KeiroD commented Sep 3, 2024

Also having this issue. Seems to not be working here in Debian 12, nginx 1.18.

I also made sure to include the file whitelist-ips.conf into the main default.conf as well and that does not seem to be properly overriding the blacklist when I was testing this. Also... does this cover IPv6 IPs as well? I can at least verify that curl seems to be hitting the site just fine via v6.

Interestingly it doesn't appear to be showing up in the logs anywhere for my IPs, as if I'm blocked directly in the firewall. Except that doesn't appear to be the case, as all I get when hitting the website is connection refused.

@KeiroD
Copy link

KeiroD commented Sep 12, 2024

apt remove nginx-* && apt purge nginx-* does work to get you back to a clean nginx install so that you can reinstall this if you find yourself unable to make the whitelist work. I've thus far been unable to work around the block once I trigger the block. This seems to be the only way to get it working again and then not testing lest you find yourself blocked permanently with no way to make this remove the block except by way of purging everything nginx related.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants