website/docs: add backend_override docs

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2022-02-09 10:41:42 +01:00
parent b1ad3ec9db
commit 0d92112a3f
1 changed files with 14 additions and 0 deletions

View File

@ -79,3 +79,17 @@ In this mode, the regular expressions are matched against the Request's Path.
### Forward auth (domain level)
In this mode, the regular expressions are matched against the Request's full URL.
## Dynamic backend selection
You can configure the backend the proxy should access dynamically via *Scope mappings*. To do so, create a new *Scope mapping*, with a name and scope of your choice. As expression, use this:
```python
return {
"ak_proxy": {
"backend_override": f"http://foo.bar.baz/{request.user.username}"
}
}
```
Afterwards, edit the *Proxy provider* and add this new mapping. The expression is only evaluated when the user logs into the application.