This short article explains how you can block the most common exploits, SQL injections, file injections, spam and user agents used by hackers and bandwidth hoggers from your nginx vhosts with some simple configuration directives. This configuration is far from being complete, but it’s a good starting point. You will have to watch your logs for attempted break-in attempts and then try to modify/complete the ruleset.