diff --git a/Setup-Reverse-Proxy.md b/Setup-Reverse-Proxy.md index 1d134c9..0b70876 100644 --- a/Setup-Reverse-Proxy.md +++ b/Setup-Reverse-Proxy.md @@ -129,3 +129,46 @@ $HTTP["url"] =~ "^/calibre-web" { proxy.server = ( "" => ( ( "host" => "127.0.0.1", "port" => "8083" ) ) ) } ``` + +### Traefik 2.0.0 + +traefik.toml: +``` +[log] + level = "DEBUG" + filePath = "log-file.log" + +[accessLog] + filePath = "log-access.log" + bufferingSize = 100 + +[providers] + [providers.file] + filename = "traefik-proxy.toml" + +[entryPoints] + [entryPoints.web] + address = ":80" +``` +traefik-proxy.toml: +``` +[http] + [http.middlewares] + [http.middlewares.cwHeader.headers] + [http.middlewares.cwHeader.headers.customRequestHeaders] + X-Script-Name = "/cw" + [http.middlewares.cwStrip.stripPrefixRegex] + regex = ["/cw"] + + [http.routers] + [http.routers.cw-router] + rule = "(Host(`127.0.0.1`) && PathPrefix(`/cw`))" + service = "calibre-web" + entryPoints = ["web"] + middlewares = ["cwStrip","cwHeader"] + [http.services] + [http.services.cw-router.loadbalancer] + [[http.services.cw-router.loadbalancer.servers]] + url = "http://127.0.0.1:8083" +``` +This example is only working for 127.0.0.1 for other hostnames the routing rule has to be extended. \ No newline at end of file