[英]How to Add a third party module for nginxinc/nginx-ingress configuration in kubernetes?
Goal:目标:
I am trying to include a thirdparty module a Http_more_headers to provide a custom name to the server in the headers.我正在尝试包含一个第三方模块 Http_more_headers 以在标头中为服务器提供自定义名称。
I am able to build a custom controller image with the module installed with a slightly tweaked DockerFile.我能够构建一个自定义 controller 图像,其中安装的模块稍微调整了 DockerFile。
Issue:问题:
To enable this third party module I need to add the load_module directive in the nginx.conf I am however confused on how the ingress controller interprets the nginx.conf file.要启用此第三方模块,我需要在 nginx.conf 中添加 load_module 指令,但我对入口 controller 如何解释 nginx.conf 文件感到困惑。 If I add the load_module in the server-snippet annotation, will it work?如果我在 server-snippet 注释中添加 load_module,它会起作用吗? or do I have to modify the.tmpl file to enable the third party module?还是必须修改 .tmpl 文件才能启用第三方模块? or should I just modify the nginx.conf and use a COPY during the image build itself?或者我应该只修改 nginx.conf 并在图像构建过程中使用 COPY? which would be the best way to achieve the goal?哪种方法是实现目标的最佳方式?
Use the "main-snippets" configMap key under "data" followed by the value "load_module <module_path>"使用“data”下的“main-snippets”configMap 键,后跟值“load_module <module_path>”
example:例子:
kind: ConfigMap
apiVersion: v1
data:
main-snippet: load_module /usr/lib/modules/xyz_module.so
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.