I have an nginx config which starts as follows
load_module modules/ndk_http_module.so;
load_module modules/ngx_http_set_misc_module.so;
load_module modules/ngx_http_headers_more_filter_module.so;
load_module modules/ngx_http_cache_purge_module.so;
When I use the following Dockerfile:
FROM nginx:mainline
ADD config/ /etc/nginx/
EXPOSE 80
EXPOSE 443
I get the following error when I try to run the container:
2024/01/22 19:52:07 [emerg] 8#8: dlopen() "/etc/nginx/modules/ndk_http_module.so" failed (/etc/nginx/modules/ndk_http_module.so: cannot open shared object file: No such file or directory) in /etc/nginx/nginx.conf:1
webserver | nginx: [emerg] dlopen() "/etc/nginx/modules/ndk_http_module.so" failed (/etc/nginx/modules/ndk_http_module.so: cannot open shared object file: No such file or directory) in /etc/nginx/nginx.conf:1
So, the modules are not present. My question is, how can I enable them? I found this post, which installs the modules as follows
$> sudo apt install software-properties-common
$> nginx=stable
$> sudo add-apt-repository ppa:nginx/$nginx
$> sudo apt update
$> sudo apt dist-upgrade
$> sudo apt install nginx-extras
However, the command sudo add-apt-repository ppa:nginx/$nginx throws errors
17.78 Setting up packagekit-tools (1.2.6-5) ...
17.79 Setting up software-properties-common (0.99.30-4) ...
17.90 Processing triggers for dbus (1.14.10-1~deb12u1) ...
18.15 Traceback (most recent call last):
18.15 File "/usr/bin/add-apt-repository", line 362, in <module>
18.15 sys.exit(0 if addaptrepo.main() else 1)
18.15 ^^^^^^^^^^^^^^^^^
18.15 File "/usr/bin/add-apt-repository", line 345, in main
18.15 shortcut = handler(source, **shortcut_params)
18.15 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
18.15 File "/usr/lib/python3/dist-packages/softwareproperties/shortcuts.py", line 40, in shortcut_handler
18.15 return handler(shortcut, **kwargs)
18.15 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
18.15 File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 86, in __init__
18.15 if self.lpppa.publish_debug_symbols:
18.15 ^^^^^^^^^^
18.15 File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 126, in lpppa
18.15 self._lpppa = self.lpteam.getPPAByName(name=self.ppaname)
18.15 ^^^^^^^^^^^
18.15 File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 113, in lpteam
18.15 self._lpteam = self.lp.people(self.teamname)
18.15 ^^^^^^^^^^^^^^
18.15 AttributeError: 'NoneType' object has no attribute 'people'
I'm a bit lost at this point on how to install the nginx modules?