Giter VIP home page Giter VIP logo

Comments (3)

danteali avatar danteali commented on July 1, 2024

Had the same issue. Tried all sorts of combinations of Traefik labels but couldn't get it working.

Ended up explicitly defining a backend/frontend pair in traefik.toml which works without any issues. There are a couple of services I've had to do this for since the Traefik labels haven't worked (e.g. Nextcloud, Unifi Controller).

from docker-unms.

xGlorify avatar xGlorify commented on July 1, 2024

@danteali Would you have an example of that .toml file? I'm struggling to get it online behind my Traefik reverse proxy as well.

from docker-unms.

danteali avatar danteali commented on July 1, 2024

@danteali Would you have an example of that .toml file? I'm struggling to get it online behind my Traefik reverse proxy as well.

Yeah, no problem. Just add the following to your traefik.toml file in the backend and frontend sections, point the backend at your internal UNMS address and port (I changed my UNMS port to 8040)...

[backends]
  [backends.unms]
    [backends.unms.servers]
      [backends.unms.servers.server1]
      url = "https://192.168.0.10:8040/"

[frontends]
  [frontends.unms]
  backend = "unms"
  passHostHeader = true
    [frontends.unms.routes]
      [frontends.unms.routes.route1]
      rule = "Host:unms.domain.com"

Defining frontends and backends like this allows you to use Traefik for any services on your internal network. It's really handy. Even though UNMS, and pihole docker containers run on the same server with Traefik, this was the only way I could expose them for external access. The labels wouldn't work for me.

Also remember that you can add authentication to the services exposed through Traefik like this. For example, pihole doesn't really have any authentication for it's admin page (UNMS has it's own username/password page) so you can add basic authentication by adding these lines to the [frontend] section...

  [frontends.pihole]
  backend = "pihole"
  passHostHeader = true
    [frontends.pihole.routes]
      [frontends.pihole.routes.route1]
      rule = "Host:pihole.domain.com"
    [frontends.pihole.auth.basic]
      removeHeader = true
      users = ["<username>:<password hash>"]

Generate the password hash with:
htpasswd -nb <username> '<password>'

from docker-unms.

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.