Skip to content

Instantly share code, notes, and snippets.

@psct
Created August 18, 2021 17:29
Show Gist options
  • Save psct/de4233b407e36b51b1643839e4595797 to your computer and use it in GitHub Desktop.
Save psct/de4233b407e36b51b1643839e4595797 to your computer and use it in GitHub Desktop.
example to run traefik in standalone mode (not within docker)
#!/bin/bash
#
# example to run traefik in standalone mode on a
# linux host (or any other host supported by traefik)
#
# contribution to an article in
# c't magazine 19/21, Page 74
#
# your work:
# - share port 80/443 by your router to this host
# - Download Traefik binary from:
# https://github.com/traefik/traefik/releases/latest
# - unpack to current directory, make executable
# - create files as described below
# - on windows: replace relative pathes with full
# - fit ./base.yml to your needs (e-mail adress)
# - fit ./web.yml to your needs (domain)
# - move web.yml to ./dynamic
#
mkdir -p dynamic
touch ./acme.json
chmod 600 ./acme.json
./traefik --configfile ./base.yml
exit
# create ./base.yml with the following lines:
# replace email: with your personal address
entryPoints:
web:
address: ":80"
web-secure:
address: ":443"
providers:
file:
directory: ./dynamic
watch: true
certificatesResolvers:
default:
acme:
email: [email protected]
storage: ./acme.json
httpChallenge:
entryPoint: web
api:
insecure: true
dashboard: true
log:
level: INFO
accessLog:
filePath: /dev/stdout
global:
sendAnonymousUsage: false
# create web.yml for a simple web server
# change domain behind rule:
# let url: point to your web server running on port 80
http:
routers:
otherrouter:
rule: Host(`web.example.com`)
service: otherservice
tls:
certResolver: default
services:
otherservice:
loadBalancer:
servers:
- url: http://192.168.178.10/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment