NGINX 中的加载更多头信息

我已经从 extra 安装了 nginx ,并从 community 存储库安装了其 nginx-mod-headers-more 模块软件包在 archlinux 上。

我要在主配置文件 /etc/nginx.conf 中使用其 more_set_headers 指令。

我已将以下行添加到配置文件中:

load_module '/usr/lib/nginx/modules/ngx_http_headers_more_filter_module.so';

more_set_headers 'web server'

http 块内部。

/usr/lib/nginx/modules 是软件包将模块(*.so 文件)安装后放置的位置。

重载 nginx 不会输出任何读取配置文件错误,但是该模块无法正常运行。我仍然在 403:Forbidden 页面中看到标识 nginx 名称。

在网上进行一些研究,我了解到有静态和动态模块处理方式在 nginx 中。

我是否应该使用 --add-dynamic-module 开关重新编译 nginx web 服务器,以便有效地使用 load_module 指令?

点赞