3.2.3.3.1 Restriction

Only applicable to MetaDefender Core version 4.19.0 or above.

Only allow access to our domain only

if ($host !~ ^(metadefendercore.in|www.metadefendercore.in|images.metadefendercore.in)$ ) {
return 444;
}

Deny certain user-agents

Blocking user-agents i.e. scanners, bots, and spammers who may be abusing your server.

## Block download agents ##
if ($http_user_agent ~* LWP::Simple|BBBike|wget) {
return 403;
}
##
 
## Block robots ##
if ($http_user_agent ~* msnbot|scrapbot) {
return 403;
}
##

Block referral spam

Only direct access is allowed

## Deny certain Referers ###
if ( $http_referer ~* (babes|forsale|girl|jewelry|love|nudit|organic|poker|porn|sex|teen) ) {
return 403;
}
##

How to configure

1.) Create a .conf file (create “built-in” folder if not existed)

  • On Windows, under <Installation Directory>\nginx\built-in\

  • On Linux, under /etc/ometascan/nginx.d/built-in/

Here is sample .conf file. Choose what meets to your scenario and update .conf file

if ($host !~ ^(metadefendercore.in|www.metadefendercore.in|images.metadefendercore.in)$ ) {
return 444;
}
 
if ($http_user_agent ~* LWP::Simple|BBBike|wget) {
return 403;
}
 
if ($http_user_agent ~* msnbot|scrapbot) {
return 403;
}
 
if ( $http_referer ~* (babes|forsale|girl|jewelry|love|nudit|organic|poker|porn|sex|teen) ) {
return 403;
}

2.) A restart of the “OPSWAT Metadefender Core” service is required.