• The APS Catalog has been deprecated and removed from all Plesk Obsidian versions.
    Applications already installed from the APS Catalog will continue working. However, Plesk will no longer provide support for APS applications.
  • Please be aware: with the Plesk Obsidian 18.0.78 release, the support for the ngx_pagespeed.so module will be deprecated and removed from the sw-nginx package.

Question Block user-agent and stop logging

Azurel

Silver Pleskian
Server operating system version
AlmaLinux 8.10
Plesk version and microupdate number
Plesk Obsidian 18.0.74#2
I have a non-standard User-Agent (app/scrapper) that sends thousands of requests in few seconds, which severely bloats my access_ssl_log in different domains. Is here a way to prevent/block this in Plesk? The block must target the application agent, not the originating user IP. The user IP as website visitor is welcome.

I use this rule in a global Apache config file (/etc/httpd/conf.d/block_useragents.conf) to immediately stop the requests with a non-error status and set a variable:
<Directory "/var/www/vhosts/">
RewriteEngine On
RewriteOptions inherit

RewriteCond %{HTTP_USER_AGENT} ^botname [NC]
RewriteRule .* - [R=204,L,E=nolog:1]
</Directory>

How I can instruct Plesk to skip all logging in "access_ssl_log" when the custom variable nolog is present?
 
Back
Top