Search code examples
nginxdockerreverse-proxytutum

Redirect different domains to the same apache using reverse proxy


Morning,

I'm running a dockerized envirovment (localy and on tutum for production) that consists of:

  1. nginx reverse proxy with https://github.com/jwilder/nginx-proxy

  2. Multiple sets of containers that are mainly websites with apache and things.

The reverse proxy relies on the environment variable VIRTUAL_HOST set on some apaches to redirect traffic and it works well both in development and production using different environment variables thanks to changing between foo.dev and foo.com on developent/production thanks to an aditional production.yml or different configuration on the stackfile on tutum.

But now I need to have both foo.com and foo.es served by the same web app (one will be the translation of the other provided by the same wordpress container).

What I think I need is to define multiple VIRTUAL_HOST on the stackfile/docker-compose.yml but I don't know if it's possible.

Am I missing something?

Is it possible to route both foo.com and foo.es to the same container with this setup?

Thanks!


Solution

  • Ok,

    I just needed to separate the hosts by comas on the same VIRTUAL_HOST environment variable as stated in the documentation of the reverse proxy I was using

    https://github.com/jwilder/nginx-proxy#multiple-hosts

    Sorry!