Git Product home page Git Product logo

Comments (2)

codekitchen avatar codekitchen commented on July 26, 2024

Not currently but it wouldn't be too hard. Dinghy would need a way to configure more than one TLD, then pass it on to the DNS service and resolver file creation code. The HTTP proxy doesn't actually care what the TLD is. So in theory you could even just add entries on other TLDs to /etc/hosts pointing to the VM and the HTTP proxy would serve them.

from dinghy-http-proxy.

Voziv avatar Voziv commented on July 26, 2024

The solution that works for me right now

In the process of replying with some more information on this issue I figured out a workaround that works great for my own usecase.

I manually make /etc/resolver/<filename> entries for the TLD's I want to use.

I use the following to start the container:

docker run -d --restart=always \
  -v /var/run/docker.sock:/tmp/docker.sock:ro \
  -v ~/.dinghy/certs:/etc/nginx/certs \
  -p 80:80 -p 443:443 -p 19322:19322/udp \
  -e DOMAIN_TLD='#' -e CONTAINER_NAME=http-proxy \
  --name http-proxy \
  codekitchen/dinghy-http-proxy

DNSMasq treats the # entry as a wildcard entry.

This does produce a bunch of useless nginx entries, such as web.voziv.# but nginx doesn't seem to mind it at all. I use docker-compose.yml and specify my hosts for each container there and those entries come through just fine. So far it seems nginx is serving them all up normally.

Now when I visit both domains I get the nginx proxy default page.
http://test.docker
http://test.dev


Automated solution

Some other automated options could be adding to dnsmasq.conf.

In dnsmasq.conf we could add conf-dir=/etc/dnsmasq.d and create a file per domain, or a single file with multiple address lines.

Example:

address=/docker/<docker vm ip>
address=/dev/<docker vm ip>
address=/example.com/<docker vm ip>

Not sure how to go about passing in multiple TLD's through environment variables though.


The first solution works really well for me, so I don't need this issue anymore. Feel free to close the issue if you'd like.

Edit: I figured the wildcard bit out by looking at the FreedomBen/dory-dnsmasq - Wildcard TLD

from dinghy-http-proxy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.