1
0
mirror of https://github.com/janeczku/calibre-web synced 2024-10-31 23:26:20 +00:00

Added traefik

Ozzie Isaacs 2020-06-21 10:27:17 +02:00
parent e0b784904e
commit cb86740629

@ -129,3 +129,46 @@ $HTTP["url"] =~ "^/calibre-web" {
proxy.server = ( "" => ( ( "host" => "127.0.0.1", "port" => "8083" ) ) ) 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.