How to block libwww-perl

Hi Guys I recent SEO scan of my site said I should block “libwww-perl”. Using Google I found this code (below) but what file do I modify and insert the code?

Block download agenta

 if ($http_user_agent ~* LWP::Simple|wget|libwww-perl) {
          return 403;
  1. Create a file named anything.conf (something like blockperl.conf) in /var/www/ with the content you want.
  2. Test if everything is fine with nginx -t.
  3. If the test succeeds, then reload Nginx with service nginx reload.

Theoretically, that’s all.

However, I nearly always need additional steps. I need to ee site edit and move the last include line (include /var/www/*.conf;) a few positions above, otherwise my custom rules are never interpreted by Nginx.

1 Like