Floren
Well-known member
Use the geolocation features in Nginx, easiest way to kill spammers.If I could, I would ban the entire country.
Use the geolocation features in Nginx, easiest way to kill spammers.If I could, I would ban the entire country.
IP bans are not reliable at all. You only want to protect the Registration page and redirect it to a custom registration form where the user will be moderated automatically. It can be easily done with PHP and Nginx:Nah, I would use ipset and do it properly. Do it as low as possible in the stack where it belongs.
$country = getenv('GEOIP_CITY_COUNTRY_CODE');
Excuse me? You are banning an IP, it makes more sense to do that lower in the stack than in an application if your ultimate goal is to ban an IP address. Why on earth would you let it traverse all the way up to an application to deal with?IP bans are not reliable at all. You only want to protect the Registration page and redirect it to a custom registration form where the user will be moderated automatically. It can be easily done with PHP and Nginx:
PHP:$country = getenv('GEOIP_CITY_COUNTRY_CODE');
The ultimate goal is to avoid spam and still allow legitimate viewers to read your site. IMO, moderating based on location is the proper way to do it. Of course, you can do whatever you like with your site. I was simply presenting a proper solution to the OP. Still, this is not a viable solution... IP or not. The spammer could easily use a different location/IP and register, then pass the info to his indian friends and spam you to death.Excuse me? You are banning an IP, it makes more sense to do that lower in the stack than in an application if your ultimate goal is to ban an IP address. Why on earth would you let it traverse all the way up to an application to deal with?
Totally understand but if you want to ban an IP from accessing anything you host on your server then the only way I would do it is at the stack level. Totally remove their ability to view or attempt to damage your system from that particular IP. Also it is more efficient doing it in the stack. Leaves the application to serve those legit users. There is no "correct" way, just different methods based on what they really want to do when it comes to banning the IP.The ultimate goal is to avoid spam and still allow legitimate viewers to read your site. IMO, moderating based on location is the proper way to do it. Of course, you can do whatever you like with your site. I was simply presenting a proper solution to the OP. Still, this is not a viable solution... IP or not. The spammer could easily use a different location/IP and register, then pass the info to his indian friends and spam you to death.
On the other hand, if you ban IP's you might endup discouraging 1 billion potential readers of your site.
And I would use ipset to do the same thing except lower in the stack, I ban them from the entire webserver, period. Luckily I have many servers over which different services run so I can afford to do it at that level. When it comes to banning my view is that the application shouldn't worry itself with that, let the stack or some other device further upstream do it.Personally, If I want to ban a partial IP like 123.45.*, I use one line of code in Nginx configuration.
You can if you really want.If I could, I would ban the entire country.
Because they might click on the rover eBay link some user posted on your site.If an IP is a spammer then just ban it, they are not interested in reading your content so why allow them to read it?
Why don't you just stop people from posting links until they hit 20 or so posts? That's what we do and we don't get many spammers.
IMO, disabling links will not stop a spammer. They'll just post empty replies with a smilie etc. until it reaches 20-30 posts and they will kill your site with hundreds of spam posts in minutes. Personally I think disabling links is very irritating, especially for a site where a lot of references are posted.Why don't you just stop people from posting links until they hit 20 or so posts?
They'll just post empty replies with a smilie etc. until it reaches 20-30 posts and they will kill your site with hundreds of spam posts in minutes.
I finally got tired to delete every day spam from my forums. I implemented a country based filter in Nginx for the following countries:Along with Pakistan, China and Indonesia (those would be the 4 countries I would pick myself).![]()
We use essential cookies to make this site work, and optional cookies to enhance your experience.