I'm trying to add this rule as the final, after all the other rules that allow the traffic.
iptables -A INPUT -j DROP
And this rule blocks everything.
When connecting through the web port 80, nginx throws "502 Bad Gateway". My guess that it somehow blocks some port like the database which causes the application not to respond?