Nginx setup

Docker network

  • Create a network my-services with following command
    • docker network create my-services
  • This network will be used by all the services that will be proxied by nginx.
  • It is created so that its easier for us to connect to the services from nginx just by their container name.

Create nginx proxy manager container

  • Create a directory apps in home dir
  • Inside it, create following directories:
    • apps/nginx
    • apps/nginx/data
    • apps/nginx/letsencrypt (its only required if you want to use letsencrypt)
  • Create a file apps/nginx/docker-compose.yml with following content:
version: '3.8'

services:
  nginx:
    container_name: 'nginx'
    image: 'jc21/nginx-proxy-manager:latest'
    restart: unless-stopped
    ports:
      - '80:80'
      - '81:81'
      - '443:443'
    volumes:
      - ./nginx/data:/data
      - ./nginx/letsencrypt:/etc/letsencrypt
    networks:
      - my-services

networks:
  my-services:
    name: 'my-services'
    external: true
  • Run docker-compose up -d to start nginx proxy manager.

Configure nginx proxy manager from browser