xalt/nginx_reverse_proxy
The variables in this section are shell environment variables set directly from the shell or in the "environment" entries for the relevant docker-compose.yml file.
On startup the backup server checks the variable TIMEZONE which is false by default (see the Dockerfile). If the TIME_ZONE variable is set, it attempts to update the /etc/localtime on the container.
TIMEZONE=Europe/Berlin
To restore an Nginx configuration from a backup on startup, the relevant 'BACKUP' variables need to be set as in the following example:
BACKUP_HOST=192.168.123.123
BACKUP_USER=root
BACKUP_KEY_FILE=/tmp/id_rsa
BACKUP_PATH_CERTS=/backup/confluence_demo8/nginx/certs
BACKUP_PATH_CONF=/backup/confluence_demo8/nginx/conf.d
BACKUP_PATH_HTML=/backup/confluence_demo8/nginx/www
BACKUP_PATH_VHOST=/backup/confluence_demo8/nginx/vhost.d
showing the host to restore the backup from, the user to connect with, the path to restore from and the ssh key to use for the connection.
The certificates used for the Nginx server if the BACKUP_PATH_CERTS variable is set. If it is, this is used to look on the backup server for the certifiates used and copies them to the "certs" directory under NGINX_HOME. The same principle applies to the configuration used by with BACKUP_PATH_CONF being used to set the required path to look for on the backup server and copying this saved configuration into NGINX_HOME/conf.d If BACKUP_PATH_HTML is set, files are sought on the backup server which can be copied for example ro to /var/www on the nginx server and if BACKUP_PATH_VHOST is set, virtual host configurations are sought and copied to NGINX_HOME/vhost.d
Adding a file called DONTSYNC tells the container never to restore a backup to this directory. If DONTSYNC is not present and the user sets the BACKUP_HOST variable before startup, a backup is sought on the named server which is restored to the home directory defined in NGINX_HOME.
By default the nginx server has a file called nginx.tmpl in /app. This is a template file used to create the nginx configuration automatically detecting which other servers are configured on the host machine and creating server configurations for each of them. Whenever that status of a server is changed and for example if a server goes down then this change is detected by docker-gen and the configuration for that container would be removed from the nginx configuration. This detected by the docker-gen process which can be run on the host:
docker pull xalt/nginx_reverse_proxy