Coder Social home page Coder Social logo

learn-traefik's Introduction

Learn Traefik

This repository contains examples on using traefik reverse proxy. This repository is used as a teaching aid in the training videos about Traefik, created by Kamran. These videos are available here:

The repo contains various scenarios explained with docker-compose. Please check the examples/ directory for related files.

The diagrams used in these examples are available as .xoj and as .pdf in the docs/ directory.

Topics covered in the video:

  • Traefik quick start (API and Dashboard) (/api , /health, etc) https://docs.traefik.io/configuration/api/
  • Understanding Traefik's behavior for an example docker-compose stack
  • The exposedByDefault setting
  • Using labels to setup frontends
  • Dashboard protection with passwords
  • SSL/TLS/HTTPS with self signed certificates
  • Introduction to LetsEncrypt, ACME, CertBot, etc
  • Difference between HTTP and DNS challenge
  • Difference between staging and production certificates
  • LetsEncrypt's rate limits to watch for
  • SSL/TLS/HTTPS certificates from LetsEncrypt
  • The acmeLogging directive
  • The onHostRule directive
  • Example with HTTP challenge
  • Example with DNS challenge

learn-traefik's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

learn-traefik's Issues

create new for traefik v2

can you please create new folder for traefik v2 for serving all https traefik for both the traefik web ui on 8080 to be served on an hostname on https something like https://traefik.example.com and then the web app on https something like https://webapp1.example.com all using self signed certificate and certificate authority

will appreciate it as there is currently nothing of this in existence on the internet
so pretty much create like example6 folder using latest traefki v2 https://github.com/Praqma/learn-traefik/tree/master/examples/example3

not able to see the dashboard/UI

#docker-compose.yml

version: "3"
services:
traefik:
image: traefik:alpine
labels:
- traefik.enable=true
volumes:
- /var/run/docker.sock:/var/run/docker.sock
ports:
- "6060:80"
- "6080:8080"
nginx:
image: nginx:alpine
labels:
- traefik.enable=true

apache:
image: httpd:alpine
labels:
- traefik.enable=true

tomcat:
image: tomcat:alpine
labels:
- traefik.enable=true

mysqldb:
image: mysql
environment:
- MYSQL_ROOT_PASSWORD="root"

traefik.toml

defaultEntryPoints = ["http"]
loglevel = "INFO"

sendAnonymousUsage = true

[docker]
endpoint = "unix:///var/run/docker.sock"
exposedByDefault = false

[api]
dashboard = true
entrypoint = "dashboard"

[entryPoints]
[entryPoints.http]
address = ":80"

[entryPoints.dashboard]
address = ":8080"

if i try http://localhost:6080

Issues running example 3

I'm running this on OSX. This is the log for traefik using example 3 unmodified.

time="2019-09-28T00:09:19Z" level=info msg="Using TOML configuration file /etc/traefik/traefik.toml"
time="2019-09-28T00:09:19Z" level=info msg="No tls.defaultCertificate given for https: using the first item in tls.certificates as a fallback."
time="2019-09-28T00:09:19Z" level=info msg="Traefik version v1.7.18 built on 2019-09-26_01:56:30PM"
time="2019-09-28T00:09:19Z" level=info msg="\nStats collection is disabled.\nHelp us improve Traefik by turning this feature on :)\nMore details on: https://docs.traefik.io/v1.7/basics/#collected-data\n"
time="2019-09-28T00:09:19Z" level=error msg="failed to load X509 key pair: tls: failed to find any PEM data in certificate input"
time="2019-09-28T00:09:19Z" level=info msg="Preparing server http &{Address::80 TLS:<nil> Redirect:0xc00086e640 Auth:<nil> WhitelistSourceRange:[] WhiteList:<nil> Compress:false ProxyProtocol:<nil> ForwardedHeaders:0xc0005d19c0} with readTimeout=0s writeTimeout=0s idleTimeout=3m0s"
time="2019-09-28T00:09:19Z" level=info msg="Preparing server https &{Address::443 TLS:0xc000712870 Redirect:<nil> Auth:<nil> WhitelistSourceRange:[] WhiteList:<nil> Compress:false ProxyProtocol:<nil> ForwardedHeaders:0xc0005d19e0} with readTimeout=0s writeTimeout=0s idleTimeout=3m0s"
time="2019-09-28T00:09:19Z" level=error msg="Unable to add a certificate to the entryPoint \"https\" : unable to generate TLS certificate : tls: failed to find any PEM data in certificate input"
time="2019-09-28T00:09:19Z" level=info msg="Preparing server dashboard &{Address::8080 TLS:<nil> Redirect:<nil> Auth:0xc0007527e0 WhitelistSourceRange:[] WhiteList:<nil> Compress:false ProxyProtocol:<nil> ForwardedHeaders:0xc0005d1a00} with readTimeout=0s writeTimeout=0s idleTimeout=3m0s"
time="2019-09-28T00:09:19Z" level=info msg="Starting provider configuration.ProviderAggregator {}"
time="2019-09-28T00:09:19Z" level=info msg="Starting server on :80"
time="2019-09-28T00:09:19Z" level=info msg="Starting server on :443"
time="2019-09-28T00:09:19Z" level=info msg="Starting server on :8080"
time="2019-09-28T00:09:19Z" level=info msg="Starting provider *docker.Provider {\"Watch\":true,\"Filename\":\"\",\"Constraints\":null,\"Trace\":false,\"TemplateVersion\":2,\"DebugLogGeneratedTemplate\":false,\"Endpoint\":\"unix:///var/run/docker.sock\",\"Domain\":\"\",\"TLS\":null,\"ExposedByDefault\":false,\"UseBindPortIP\":false,\"SwarmMode\":false,\"Network\":\"\",\"SwarmModeRefreshSeconds\":15}"
time="2019-09-28T00:09:19Z" level=error msg="failed to load X509 key pair: tls: failed to find any PEM data in certificate input"
time="2019-09-28T00:09:19Z" level=info msg="Server configuration reloaded on :80"
time="2019-09-28T00:09:19Z" level=info msg="Server configuration reloaded on :443"
time="2019-09-28T00:09:19Z" level=info msg="Server configuration reloaded on :8080"

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.