Dockerizing nginx with LDAP module based on centos:7
.
Because the official nginx docker image does not support LDAP module by itself, you have to get nginx source and compile with LDAP module. This image include nginx-auth-ldap module, so you don't need to compile.
Clone this.
git clone https://github.com/shyr/nginx_ldap_dockerfile.git
You need to have your nginx configuration file. Please modify default.conf and conf/nginx.conf as your environment.
Then you can make you Nginx docker image.
$ docker build -t [YOUR_IMAGE_NAME] .
A nginx version is specified in Dockerfile. Fix ENV NGINX_VERSION as you want.
To add another module you need to modify Dockerfile.
- Get module source and unzip.
- Specify where the module exist with
./configure --add-module=[MODULE PATH]
command.
To get more details about nginx configuration, please refer to followings.
http://www.allgoodbits.org/articles/view/29