Subdomains on a coreOS system

By | January 12, 2018

I am looking into using docker to run a view different development environments.

I want to port those environments out to various subdomains using server blocks with nginx.

Is it possible to set up server blocks on a CoreOS system? I am under the impression that all environments you set up must be a docker container, I was unsure how this would work if I wanted to set up all my subdomains for one instance of nginx when this instance would have to run standalone in a dockerized container.

Would I be better to set up something like ubuntu nginx installed at the base and then individual docker instances in each server block (subdomain) folder.


Yes, this is absolutely possible. It involves two steps:

  1. Service discovery for the docker containers that make up your development environments. This means writing their IP:port combo into etcd when the containers are started.
    This blog post goes into detail on the service registration part of it:

  2. Using confd to dynamically write out your nginx config. Confd will read from etcd and use a loop to set up your server blocks. Nginx will then be reloaded to apply the new settings.
    You can see this all put together in this blog post:

Confd Github:

Leave a Reply

Your email address will not be published. Required fields are marked *