tiredofit / docker-nginx-ldap

Docker Nginx Image w/LDAP Authentication, Zabbix agent monitoring, S6 init, logrotate based on Alpine
MIT License
11 stars 4 forks source link
docker ldap logrotate nginx s6-overlay zabbix-agent

hub.docker.com/r/tiredofit/nginx-ldap

Build Status Docker Pulls Docker Stars Docker 
Layers

Introduction

This will build a container for Nginx w/ LDAP Authentication Enabled

This Container uses tiredofit:alpine:3.7 as a base.

Changelog

Authors

Table of Contents

Prerequisites

This image assumes that you are using a reverse proxy such as jwilder/nginx-proxy and optionally the Let's Encrypt Proxy Companion @ https://github.com/JrCs/docker-letsencrypt-nginx-proxy-companion in order to serve your pages. However, it will run just fine on it's own if you map appropriate ports.

Installation

Automated builds of the image are available on Docker Hub and is the recommended method of installation.

docker pull tiredofit/nginx-ldap

Quick Start

Configuration

Data-Volumes

The container starts up and reads from /etc/nginx/nginx.conf for some basic configuration and to listen on port 73 internally for Nginx Status responses. /etc/nginx/conf.d contains a sample configuration file that can be used to customize a nginx server block. The LDAP configuration resides in the /etc/nginx/conf.d/01-ldap.conf upon container start.

The following directories are used for configuration and can be mapped for persistent storage.

Directory Description
/www/html Drop your Datafiles in this directory to be served by Nginx
/www/logs Logfiles for Nginx error and access

Environment Variables

Along with the Environment Variables from the Base image, below is the complete list of available options that can be used to customize your installation.

Authentication Options

Parameter Description
AUTHENTICATION_TYPE Protect site - NONE,BASIC,LLNG - Default NONE
WEB_USER If BASIC chosen enter this for the username to protect site
WEB_PASS If BASIC chosen enter this for the password to protect site
LLNG_HANDLER_HOST If LLNG chosen use hostname of handler - Default llng-handler
LLNG_HANDLER_PORT If LLNG chosen use this port for handler - Default 2884

The LLNG option is for when using LemonLDAP:NG Handlers to protect your application and require modification to the /etc/nginx/conf.d/default.llng file to fully work properly!

General Options

Parameter Description
UPLOAD_MAX_SIZE Maximum Upload Size for Nginx (e.g 2G)
LDAP_HOST Hostname and port number of LDAP Server (e.g. ldapserver:389)
LDAP_BIND_DN User to Bind to LDAP (e.g. cn=admin,dc=orgname,dc=org)
LDAP_BIND_PW Password for Above Bind User (e.g. password)
LDAP_BASE_DN Base Distringuished Name (e =dc=hostname,dc=com
LDAP_ATTRIBUTE Unique Identifier Attrbiute (e.g. uid)
LDAP_SCOPE LDAP Scope for searching (e.g. sub)
LDAP_FILTER Define what object that is searched for (e.g. objectClass=person)
LDAP_GROUP_ATTRIBUTE If searching inside of a group what is the Group Attribute (e.g. uniquemember)

Networking

The following ports are exposed.

Port Description
80 HTTP
443 HTTPS

Maintenance

Shell Access

For debugging and maintenance purposes you may want access the containers shell.

docker exec -it (whatever your container name is e.g. nginx-ldap) bash

References