July 31

deny connection by user agent in nginx

to deny connection by user agent put the following line on your nginx config:

if ($http_user_agent ~ (Synapse) ) {
return 403;
}

For multi block:

if ($http_user_agent ~ ("Synapse|some_agent|and_another_agent") ) {
return 403;
}

in case with Engintron, put it to /etc/nginx/custom_rules


Copyright 2021. All rights reserved.

Posted 31 July 2017 by admin in category "simple memo

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.