wiki:NGINX HowTo Install Using Docker

Version 12 (modified by saj.issa, 8 years ago) ( diff )

--

Prerequisites if required

Step 1 - Install Git

$ sudo apt-get update

$ sudo apt-get install git

Step 2 - Install Docker

Docker HowTo Install

Install NGINX using Docker

  1. On the host machine go to directory

cd /local/docker/<USER>/

  1. Go to this directory and checkout from docker_nginx_ssl

sudo git clone https://github.com/LCBRU/docker_nginx_ssl.git

sudo chmod -R 777 docker_nginx_ssl/

This will create a directory /local/docker/<USER>/docker_nginx_ssl

  1. Move to this directory

cd /local/docker/<USER>/docker_nginx_ssl/

  1. Ensure you have the directory /share on your host machine. Copy nginx.conf to /share

cp nginx.conf /share

  1. Create a directory /share/cert/live ensure the files .cer .csr .key already exist. If not read NGINX Generate SSL Certificate
  1. Configure /share/nginx.conf as necessary to include files and set client direct requests to the appropriate backend webapps.
  1. Modify index.html as necessary

sudo vi /local/docker/<USER>/docker_nginx_ssl/index.html

  1. To build the image :

sudo docker build -t lcbruit/nginx_ssl:v1.1 .

  1. To run the docker container :

sudo docker run -d -p 80:80 -p 443:443 -e 'DH_SIZE=512' -v /share:/etc/nginx/external/ lcbruit/nginx_ssl:v1.1

  1. Test NGINX :

http://XXXXXXXXXXXXXX.xuhl-tr.nhs.uk

  1. Test necessary client direct requests

Further Info

NGINX acts as a reverse proxy and directs client requests to the appropriate back-end applications

For example

docker_redcap_upgrade Port 82

docker_appointments Port 81

Note: See TracWiki for help on using the wiki.