abiosoft / abiosoft/caddy-yaml

How to properly use forward_auth?

Aperta
#7 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Go
Stelle
30
Fork
2
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Hi! Could you please provide an example of using `forward_auth`?
When I try to use it, I get the following error:

```
caddy | Error: loading initial config: loading new config: loading http app module: provision http: server web: setting up route handlers: route 1: loading handler modules: position 0: loading module 'subroute': provision http.handlers.subroute: setting up subroutes: route 0: loading handler modules: position 0: loading module 'forward_auth': unknown module: http.handlers.forward_auth
```

Config example:

```
x-forwardAuth: &forwardAuth
handler: forward_auth
uri: "host.docker.internal:8090/api/otp/verify"

apps:
http:
servers:
web:
listen:
- ":443"
- ":80"

routes:
- match:
- host: ["nginx.#{ $BASE_DOMAIN }"]
handle:
- handler: subroute
routes:
- handle:
- <<: *forwardAuth
- handler: reverse_proxy
upstreams:
- dial: "nginx:80"
```

I tried to see how it looks in the JSON configuration format, but Caddy converts forward_auth into a huge number of rules related to reverse_proxy…

https://caddyserver.com/docs/caddyfile/directives/forward_auth

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.