从虚拟环境中的 pip 安装的 uWSGI 无法识别 http-auto-gzip

uWSGI installed from pip inside virtual env does not recognize http-auto-gzip

在 Debian Buster Docker 容器中,我首先安装 python3python3-pippython-venv,这让我创建了一个 python 3.7。 3 venv,使用

python3 -m venv ./venv_name

我以典型方式激活。在里面,我使用

pip install uwsgi

安装 uWSGI(本例中为 2.0.19.1 版)。我有一个 uwsgi.ini 文件,其中包含:

[uwsgi]
strict = true
master = true
http-auto-chunked = true
http-keepalive = 1
http-auto-gzip = true
http-timeout = 360

等但是,当我尝试从命令行启动 uwsgi 时:

uwsgi --ini uwsgi.ini

我收到错误:

[strict-mode] unknown config directive: http-auto-gzip

导致此错误的原因是什么?一些搜索表明它与缺少的插件有关,而且 http 插件嵌入在 pip 安装中。我已经尝试通过添加

来明确命名插件
plugins = http

到 ini 文件,但这会导致错误:

!!! UNABLE to load uWSGI plugin: ./http_plugin.so: cannot open shared object file: No such file or directory !!!

基于the source code here http-auto-gzip仅在使用UWSGI_ZLIB标志编译uWSGI时可用。

您需要在安装(编译)uWSGI 时安装 zlib1g-dev Ubuntu 包。