ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Traefik Reverse Proxy

    IT Discussion
    traefik reverse proxy
    2
    3
    374
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • stacksofplatesS
      stacksofplates
      last edited by stacksofplates

      Traefik is a reverse proxy that integrates well with things like Docker, K8s, Consul, etcd, etc. However it has a nice file mode also. It's written in Go so it's a single static binary and doesn't need restarted with config changes. If your application has health checks, you can leverage those as well. You can get the binary from the releases page.

      By default it looks for the config traefik.toml in /etc/traefik/, $HOME/.traefik, or the directory the executable is in. It's simple to set up. Here's the full file for a single backend:

      traefik.toml

      defaultEntryPoints = ["http"]
      [entryPoints]
        [entryPoints.http]
        address = ":80"
      
      [file]
      
      [backends]
        [backends.backend1]
          [backends.backend1.servers.server1]
             url = "http://10.1.30.134"
      
      [frontends]
        [frontends.frontend1]
            backend = "backend1"
            passHostHeader = true
            [frontends.frontend1.routes.example]
                rule = "Host:staticpage.test.com"
      

      If you want to enable the dashboard, it would look like this:

      defaultEntryPoints = ["http"]
      [entryPoints]
        [entryPoints.http]
        address = ":80"
      
      [api]
        entryPoint = "traefik"
        dashboard = true
        address = ":8080"
      
      [file]
      
      [backends]
        [backends.backend1]
          [backends.backend1.servers.server1]
             url = "http://10.1.30.134"
      
      [frontends]
        [frontends.frontend1]
            backend = "backend1"
            passHostHeader = true
            [frontends.frontend1.routes.example]
                rule = "Host:staticpage.test.com"
      

      Then visiting port 8080 gives you the dashboard:

      traefik-dashboard.png

      1 Reply Last reply Reply Quote 4
      • F
        flaxking
        last edited by

        Are you currently using it in production?

        stacksofplatesS 1 Reply Last reply Reply Quote 0
        • stacksofplatesS
          stacksofplates @flaxking
          last edited by

          @flaxking said in Traefik Reverse Proxy:

          Are you currently using it in production?

          Not at work. I'm using it for projects outside of that though. My docker compose stack at home uses it.

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post