element-hq / element-hq/matrix-authentication-service
Sample caddyfile for synapse and mas
- Dominant language
- Rust
- Stars
- 280
- Forks
- 111
- Avg merge
- 3d 1h
- Merged PRs (30d)
- 25
Description
**Describe the bug**
Directly adding directives to caddyfile does not work.
**To Reproduce**
Steps to reproduce the behavior:
1. Setup MAS and Synapse
2. Add new directives to caddyfile
3. Restart caddy
4. Authentication and redirection does not work with 404
**Expected behavior**
For example, element web logs in successfully.
**Additional context**
Caddyfile
```
matrix.{$INTERNALDOMAIN} {
# special headers say
import matrix-synapse yes
#redir / /_matrix/static
reverse_proxy /_matrix/* synapse-server:8008
# mas
reverse_proxy /_matrix/client/*/login synapse-auth:8080
reverse_proxy /_matrix/client/*/logout synapse-auth:8080
reverse_proxy /_matrix/client/*/refresh synapse-auth:8080
# protected admin endpoint
redir /_synapse/admin /_synapse/admin/
handle_path /_synapse/admin/* {
reverse_proxy synapse-server:8008
import internal-access yes
}
# # # add sliding sync for element x
reverse_proxy /sliding-sync/* sliding-sync:8009
# part for worker redirect
reverse_proxy /_synapse/client/* {
to synapse-worker-1:8081 synapse-background-1:8081
lb_policy ip_hash {
fallback first
}
health_uri /health
health_port 8081
health_interval 15m
health_timeout 15s
health_follow_redirects
}
# redirect for admin page
redir /admin /admin/
handle_path /admin/* {
reverse_proxy synapse-admin:80
import internal-access yes
}
}
```
Contributor guide
Assessment
This issue has not been assessed yet.