SearxNG

清夏晚风

SearXNG 搜索引擎

SearXNG是一个开源、免费、尊重隐私的搜索引擎,其主要原理是通过抓取公开的搜索引擎数据并处理,返回用户需要的信息。

SearXNG和SearX是不同的两个分支,本文以SearXNG为例。

拉取仓库

本文采用docker compose 部署项目,因此拉取searxng/searxng-docker仓库

1
2
git clone https://github.com/searxng/searxng-docker.git
cd searxng-docker

设置环境变量

1
nano .env

主要修改以下环境变量:

1
2
3
SEARXNG_HOSTNAME=searxng.example.com
SEARXNG_UWSGI_WORKERS=16
SEARXNG_UWSGI_THREADS=16

SEARXNG_HOSTNAME :你的域名,用于访问搜索引擎
SEARXNG_UWSGI_WORKERS :uWSGI工作进程数,根据服务器性能调整
SEARXNG_UWSGI_THREADS :uWSGI线程数,根据服务器性能调整

生成密钥

1
sed -i "s|ultrasecretkey|$(openssl rand -hex 32)|g" searxng/settings.yml

更新

1
2
3
git pull
docker compose pull
docker compose up -d

我的配置

settings.yml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# see https://docs.searxng.org/admin/settings/settings.html#settings-use-default-settings
use_default_settings:
engines:
keep_only:
- 360search
- 360search videos
- acfun
- baidu
- baidu kaifa
- baidu images
- bilibili
- sogou
- sogou images
- sogou videos
- sogou wechat
- quark
- quark images
- iqiyi

server:
# base_url is defined in the SEARXNG_BASE_URL environment variable, see .env and docker-compose.yml
secret_key: "xxxxxxxxxxxxxxxx" # change this!
limiter: false # enable this when running the instance for a public usage on the internet
image_proxy: true

ui:
static_use_hash: true

redis:
url: redis://redis:6379/0

engines:
- name: 360search
disabled: false
- name: 360search videos
disabled: false
- name: acfun
disabled: false
- name: baidu
disabled: false
- name: baidu kaifa
disabled: false
- name: baidu images
disabled: false
- name: bilibili
disabled: false
- name: sogou
disabled: false
- name: sogou images
disabled: false
- name: sogou videos
disabled: false
- name: sogou wechat
disabled: false
- name: quark
disabled: false
- name: quark images
disabled: false
- name: iqiyi
disabled: false

outgoing:
request_timeout: 2.0 # default timeout in seconds, can be override by engine
max_request_timeout: 5.0 # the maximum timeout in seconds
useragent_suffix: "" # information like an email address to the administrator
pool_connections: 100 # Maximum number of allowable connections, or null
# for no limits. The default is 100.
pool_maxsize: 10 # Number of allowable keep-alive connections, or null
# to always allow. The default is 10.
enable_http2: true # See https://www.python-httpx.org/http2/
  • Title: SearxNG
  • Author: 清夏晚风
  • Created at : 2026-01-13 16:48:23
  • Updated at : 2026-01-13 16:48:23
  • Link: https://blog.kimikkorow.eu.org/浏览器相关/搜索引擎/SearxNG/SearxNG/
  • License: This work is licensed under CC BY-NC-SA 4.0.