Skip to content
This project enables automation in exposing Docker containers via NGINX.
Python HTML Shell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Docker Nginxify

This project enables automation in exposing Docker containers via NGINX. In particular, it:

  1. parses JSON configurations and create conf files
  2. creates a NGINX instance with mounted folders
  3. generates basic authentication file
  4. exposes basic admin via the file

Manage via

usage [clean_conf | gen_default | gen_all | start | restart | reload | stop]


  1. clean_conf: removes all the configuration from nginx/conf.d/
  2. gen_default: generates only the default.conf file
  3. gen_all: generates all the configurations files from the nginx_conf.json file
  4. start: starts the docker container of nginx
  5. restart: restarts the docker container
  6. reload: reloads the configuration in nginx/conf.d/
  7. stop: stops the container and clean the current folder

Manual Configurations

Generate Proxy configurations

The python script can be used to generate *.conf files.

./ --help

usage: [-h] [--default ONLY_DEFAULT] [--dest DEST_FOLDER]
                   [--conf CONFS_FILE] [--overwrite OVERWRITE]

nginx conf generator

optional arguments:
  -h, --help            show this help message and exit
  --default ONLY_DEFAULT
                        if true generate only the default configurations
  --dest DEST_FOLDER    The folder to save the *.conf files. Default value
  --conf CONFS_FILE     The json file with the configurations. Default value
  --overwrite OVERWRITE
                        True to overwrite all the configurations files

Json File Structure

The file contains a list of proxies with:

  • name: the name of the proxy
  • server_names: the name of the domain name to expose the service
  • docker_name: the name or ip address of the docker container to expose
  • docker_port: the internal port of the container
  • secured: if the service should be secured with nginx auth_basic
  "proxies": [
      "name": "spark",
      "servers": [
      "dockers": [
      "secured": true
      "name": "es",
      "servers": [
      "dockers": [
      "docker_name": "es-data-0",
      "docker_port": "9200",
      "secured": true
      "name": "datatoknowledge",
      "servers": [
      "dockers": [
      "secured": false

Password generator

The script can be used to generate a file that stores the access passwords. By default it stores all the password in /nginx/htpasswd/secure. This file is mapped to the running docker container.


./ --help
usage: [-h] [--file DEST_FOLDER] [--user USER]
                             [--pwd PWD]

nginx auth file generator

optional arguments:
  -h, --help          show this help message and exit
  --file DEST_FOLDER  the folder to save the new username:password pair
  --user USER         the username for the new user
  --pwd PWD           the password for the new user

Index 404 and 50x pages

As default there is a custom_404 custom_50x and index page in the folder ./nginx/www/html. If you need you can change these pages.


  • To generate NGINX conf via json configuration file
  • To start an NGINX instance via dockr-compose
  • To generate basic authentications
  • To generate json file from docker inspection
  • To generate json file from weave inspection
  • To implement web admin gui
You can’t perform that action at this time.