Through traffic source analysis, we found some problems with entering this site through certain domain names and maliciously clicking on ads. How to block these domain names through nginx rules?
if ( $host = "www.xxx.net" or $host = "ads.xxx.com" ) {
rewrite ^/(.*)$ http://www.sdfdsfgffghgf3sdfsdsdfsdf.com/ permanent;
}
The above rules are invalid, please help an expert write a rule.
I tried the above methods but failed.
Excuse me, in which paragraph are the above rules placed?
I found this rule on some websites:
RewriteEngineOn
Block domain
RewriteCond %{HTTP_REFERER} ads.acesse.com [NC]
RewriteRule ^(.*)$ -[F]
Is it correct if it is converted into nginx rules:
}
if ($rule_0 = "1"){
rewrite ^/(.*)$ /-[F];
}
Please ask experts to help you judge.
Required effect: Ban jumping to the target site through a certain domain name, such as jumping from xxx.com to aaa.com to maliciously increase traffic and click on ads:
Environment: nginx
Rules:
Just put the above rules in the server section. After two days of testing, no redirection has been found through a certain domain name.
Yours is just server_name jump,
According to what you said, it should be judged by the source,
So you have to judge the refer
The above is a whitelist system, blacklist rules can also be used
Add the following code to the server: