• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.

httpd, nginx .htaccess rules

tkalfaoglu

Silver Pleskian
A customer got fed up with hacking attempts from various countries and asked me to block all but one country.
So I first set up a .htaccess file with lots of "allow from x.x.x.x/x" and one "deny all" ..

This quickly did not work; giving a 304 to everyone.. I figured it was because nginx is in front of apache. So, instead I used the plesk GUI, went into Web Server Settings for that domain and in the very bottom box, one for nginx, I entered lots of
allow x.x.x.x;
allow y.y.y.y;
deny z.z.z.z;
type entries.

Well, it still does not work; this time the proxy_access.log file shows:
2015/09/05 10:03:10 [error] 16046#0: *855 access forbidden by rule, client: 13.4.34.12, server: blabla.com, request: "GET / HTTP/1.1", host: "blabla.com"

where the 13.4.34.12 is my own server's IP address (IP address modified for security)

So, both nginx and apache appear to verify the entries in their access files against the server's own IP address.

This defies logic; any ideas what to do?
Thanks, -turgut
 
Hi tkalfaoglu,

if you just define rules at apache2 and nginx, you surely will see the access requests from the forbidden IPs in your depending logs. The requested content just won't be delivered to the IP that requested the content. Please use a different browser and not the one with possible cache files, if you test it with your own IP.
Please start using Fail2ban to ban as well the IPs over iptables, to avoid future acceess requests from unwanted IPs. Please read as well the manual of Fail2Ban and how to ban returning intruders ( hint: "[recidive] jail" ).
 
Back
Top