nginx.conf

c0nw0nk nginx-forum at forum.nginx.org
Fri Dec 16 06:05:36 UTC 2016


xstation Wrote:
-------------------------------------------------------
> eneted this in  the conf file under http
> 
> SetEnvIfNoCase User-Agent "^Baiduspider" block_bot
> Order Allow,Deny
> Allow from All
> Deny from env=block_bot
> 
> 
> but on restart got a error message
> 
> Job for nginx.service failed. See 'systemctl status nginx.service' and
> 'journalctl -xn' for details.
> root at mail:~#

That is an config for Apache web server on Nginx you want to do this. Put
inside location {} or server {}

if ($http_user_agent ~ "^Baiduspider") {
return   403;
}

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,271581,271582#msg-271582



More information about the nginx mailing list