Closed wsw70 closed 8 months ago
I had it all wrong on so many levels. The correct configuration is
caddy: "sharry.swtk.eu"
caddy.route.0_handle: /
caddy.route.0_handle.0_import: "authenticate-with-authelia"
caddy.route.0_handle.1_reverse_proxy: "sharry:9090"
caddy.route.1_handle: /app/login
caddy.route.1_handle.0_import: "authenticate-with-authelia"
caddy.route.1_handle.1_reverse_proxy: "sharry:9090"
caddy.route.2_handle: /app/home
caddy.route.2_handle.0_import: "authenticate-with-authelia"
caddy.route.2_handle.1_reverse_proxy: "sharry:9090"
caddy.route.3_handle.0_reverse_proxy: "sharry:9090"
route
parthandle_path
instead of handle
(taken from the example)You can simplify it by using a named matcher:
@authenticated path / /app/login /app/home
handle @authenticated {
import authenticate-with-authelia
reverse_proxy sharry:9090
}
handle {
reverse_proxy sharry:9090
}
Shouldn't you use {{upstreams 9090}}
instead? That way it'll auto-populate the upstreams if you have multiple replicas running etc.
And you don't need the wrapping route
around the whole thing, it doesn't do anything for you.
I would like to convert to labels the followig Caddyfile
I tried to find a way that follows the documentation and ended up with
My idea is that the first underscored digit is the index of the entry in
route
, and for a given one, the underscored digit would be the order of statements. is this the correct approach?I tried to make sense of the compiled configuration via the
:2019/config/
JSON but it is a bit too complex for me.