I'm running two mongrels under an Nginx server. I keep getting requests for a nonexistent file. The IP addresses change frequently but the referring URL stays the same. I'd like to resolve this.
相关问题
- How can I prevent my Shiny App from disconnecting
- Can't configure nginx as a proxy for tomcat wi
- How to set Nginx URI to fix empty URI in redirect
- why does connect domain to “Shopify” ask for eithe
- Nginx with Daphne gives 502 Bad Gateway
Using Nginx map module is a a bit more efficient and easier to manage as the list gets long.
Put this in your http {} block :
Put this in your server {} block:
It worked for me.
Got this from http://fadeit.dk/blog/post/nginx-referer-spam-blacklist
https://calomel.org/nginx.html
Block most "referrer spam" -- "more of an annoyance than a problem"
nginx.conf
I've been in a similar situation before where I needed to block people based on behaviour instead of other arbitrary rules that a firewall could sort out on its own.
They way I worked around the problem was to make my logic (Rails in your case) do the blocking... But a long way round:
The reason I do it this way around (rather than just giving Django permissions to alter firewall config) is simply: security. If my application were hacked, I wouldn't want it to hurt anything else.
The bash script is something like this:
I have created module for checking incoming IP in black lists https://github.com/oneumyvakin/ngx_http_blacklist_lookup_module
it's uses blacklists from projecthoneypot.org, blocklist.de and uceprotect.net