Skip to content

KilikFr/docker-proxy

Repository files navigation

Install a Nginx reverse Proxy

This docker pod run a nginx reverse proxy, and use VIRTUAL_HOST in docker-compose of your projects to route the http trafic.

With LETSENCRYPT_HOST and LETSENCRYPT_EMAIL setup it try to generate and renew certificates with Letsencrypt.

cd ~/docker
git clone https://github.com/KilikFr/docker-proxy.git proxy
cd proxy
cp .env.dist .env

Update your .env setup.

nano .env

Start the proxy

make start

Stop the proxy

make stop

You need to setup VIRTUAL_HOST in your docker projects:

An example project (docker-compose.yml):

version '2'
services:
    nginx:
        build: docker/nginx
        ports:
            - ${HTTP_PORT}
        links:
            - php
        volumes_from:
            - php
        environment:
             VIRTUAL_HOST: ${VIRTUAL_HOST}
             LETSENCRYPT_HOST: ${LETSENCRYPT_HOST}
             LETSENCRYPT_EMAIL: ${LETSENCRYPT_EMAIL}

networks:
    default:
        external:
            name: ${PROXY_NETWORK}