Home

Awesome

Dip Nginx

Nginx proxy configuration for Dip infra services.

Usage

  1. Add a service to the application's dip.yml.
infra:
  nginx:
    git: https://github.com/bibendi/dip-nginx.git
  1. Add a network to the application's docker-compose.yml.
networks:
  nginx-net:
    name: ${DIP_INFRA_NETWORK_NGINX}
    external: true

Where DIP_INFRA_NETWORK_NGINX is a special variable that is set by Dip.

  1. Add a VIRTUAL_HOST environment variable and the nginx-net network to a Docker Compose service.
services:
  app:
    environment:
      VIRTUAL_HOST: some.lvh.me
    networks:
      - default
      - nginx-net
  1. Start infra services.
dip infra up
  1. Start the app
dip up
  1. Send a request to the app
curl -L http://some.lvh.me
  1. In case of a container to container communication use the following command:
# inside a container
curl -L http://host.docker.internal -H 'Host: some.lvh.me'