diff options
author | Markus Heiser <markus.heiser@darmarit.de> | 2019-12-04 17:30:34 +0100 |
---|---|---|
committer | Markus Heiser <markus.heiser@darmarit.de> | 2019-12-12 13:24:18 +0100 |
commit | 0a7479f1942a9e5fa63f55eda0977ce777088c71 (patch) | |
tree | 99f967bcea3056b1c21c0adf09ef806bbbfe6a1a /docs | |
parent | af2cae6d1d71859e867a9fbc5da604ef6a898794 (diff) | |
download | searxng-0a7479f1942a9e5fa63f55eda0977ce777088c71.tar.gz searxng-0a7479f1942a9e5fa63f55eda0977ce777088c71.zip |
doc: [fix] WARNING: Could not lex literal_block as "json"
docs/admin/filtron.rst:24: \
WARNING: Could not lex literal_block as "json". Highlighting skipped.
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'docs')
-rw-r--r-- | docs/admin/filtron.rst | 155 |
1 files changed, 93 insertions, 62 deletions
diff --git a/docs/admin/filtron.rst b/docs/admin/filtron.rst index c422cb0a8..9e55d5968 100644 --- a/docs/admin/filtron.rst +++ b/docs/admin/filtron.rst @@ -23,68 +23,99 @@ An example configuration can be find below. This configuration limits the access .. code:: json - [ - { - "name": "search request", - "filters": ["Param:q", "Path=^(/|/search)$"], - "interval": <time-interval-in-sec>, - "limit": <max-request-number-in-interval>, - "subrules": [ - { - "name": "roboagent limit", - "interval": <time-interval-in-sec>, - "limit": <max-request-number-in-interval>, - "filters": ["Header:User-Agent=(curl|cURL|Wget|python-requests|Scrapy|FeedFetcher|Go-http-client)"], - "actions": [ - {"name": "block", - "params": {"message": "Rate limit exceeded"}} - ] - }, - { - "name": "botlimit", - "limit": 0, - "stop": true, - "filters": ["Header:User-Agent=(Googlebot|bingbot|Baiduspider|yacybot|YandexMobileBot|YandexBot|Yahoo! Slurp|MJ12bot|AhrefsBot|archive.org_bot|msnbot|MJ12bot|SeznamBot|linkdexbot|Netvibes|SMTBot|zgrab|James BOT)"], - "actions": [ - {"name": "block", - "params": {"message": "Rate limit exceeded"}} - ] - }, - { - "name": "IP limit", - "interval": <time-interval-in-sec>, - "limit": <max-request-number-in-interval>, - "stop": true, - "aggregations": ["Header:X-Forwarded-For"], - "actions": [ - {"name": "block", - "params": {"message": "Rate limit exceeded"}} - ] - }, - { - "name": "rss/json limit", - "interval": <time-interval-in-sec>, - "limit": <max-request-number-in-interval>, - "stop": true, - "filters": ["Param:format=(csv|json|rss)"], - "actions": [ - {"name": "block", - "params": {"message": "Rate limit exceeded"}} - ] - }, - { - "name": "useragent limit", - "interval": <time-interval-in-sec>, - "limit": <max-request-number-in-interval>, - "aggregations": ["Header:User-Agent"], - "actions": [ - {"name": "block", - "params": {"message": "Rate limit exceeded"}} - ] - } + [{ + "name":"search request", + "filters":[ + "Param:q", + "Path=^(/|/search)$" + ], + "interval":"<time-interval-in-sec (int)>", + "limit":"<max-request-number-in-interval (int)>", + "subrules":[ + { + "name":"roboagent limit", + "interval":"<time-interval-in-sec (int)>", + "limit":"<max-request-number-in-interval (int)>", + "filters":[ + "Header:User-Agent=(curl|cURL|Wget|python-requests|Scrapy|FeedFetcher|Go-http-client)" + ], + "actions":[ + { + "name":"block", + "params":{ + "message":"Rate limit exceeded" + } + } ] - } - ] + }, + { + "name":"botlimit", + "limit":0, + "stop":true, + "filters":[ + "Header:User-Agent=(Googlebot|bingbot|Baiduspider|yacybot|YandexMobileBot|YandexBot|Yahoo! Slurp|MJ12bot|AhrefsBot|archive.org_bot|msnbot|MJ12bot|SeznamBot|linkdexbot|Netvibes|SMTBot|zgrab|James BOT)" + ], + "actions":[ + { + "name":"block", + "params":{ + "message":"Rate limit exceeded" + } + } + ] + }, + { + "name":"IP limit", + "interval":"<time-interval-in-sec (int)>", + "limit":"<max-request-number-in-interval (int)>", + "stop":true, + "aggregations":[ + "Header:X-Forwarded-For" + ], + "actions":[ + { + "name":"block", + "params":{ + "message":"Rate limit exceeded" + } + } + ] + }, + { + "name":"rss/json limit", + "interval":"<time-interval-in-sec (int)>", + "limit":"<max-request-number-in-interval (int)>", + "stop":true, + "filters":[ + "Param:format=(csv|json|rss)" + ], + "actions":[ + { + "name":"block", + "params":{ + "message":"Rate limit exceeded" + } + } + ] + }, + { + "name":"useragent limit", + "interval":"<time-interval-in-sec (int)>", + "limit":"<max-request-number-in-interval (int)>", + "aggregations":[ + "Header:User-Agent" + ], + "actions":[ + { + "name":"block", + "params":{ + "message":"Rate limit exceeded" + } + } + ] + } + ] + }] @@ -101,7 +132,7 @@ It listens on 127.0.0.1:4004 and forwards filtered requests to 127.0.0.1:8888 by Use it along with ``nginx`` with the following example configuration. -.. code:: bash +.. code:: nginx location / { proxy_set_header Host $http_host; |