Running synapse without nginx #47
Closed
opened 2025-05-23 16:45:32 +00:00 by Ghost
·
5 comments
No Branch/Tag Specified
main
renovate/matrixdotorg-synapse-1.x
renovate/ghcr.io-element-hq-matrix-authentication-service-1.x
renovate/dock.mau.dev-mautrix-telegram-0.x
newmain3
upgrade-7.2.0+v1.154.0
upgrade-7.2.1+v1.155.0
compress-and-federate2
renovate/postgres-18.x
chore/meet.wiki.cafe-deployment
fix/3wc/server-name
compress-and-federate
add-matrix-authentication-service
feat/3wc/caddy
compress
feature/add-qr-login
6.8.1fix
auto_join_room_list
auto-join-rooms
cas_expose_maxupload
old-signing-key
added-env-vars
addtional-env-vars
homeserver-config-updates
backupbot
serve_server_wellknown
coturn
7.3.1+v1.157.1
7.3.0+v1.155.0
7.2.1+v1.155.0
7.2.0+v1.154.0
7.1.1+v1.149.1
7.1.0+v1.149.1
7.0.2+v1.149.1
7.0.1+v1.149.1
7.0.0+v1.149.1
6.8.3+v1.139.2
6.8.2+v1.139.2
6.8.1+v1.139.2
6.8.0+v1.139.2
6.7.1+v1.133.0
6.7.0+v1.133.0
6.6.3+v1.124.0
6.6.2+v1.124.0
6.6.1+v1.124.0
6.6.0+v1.124.0
6.5.0+v1.117.0
6.4.0+v1.116.0
6.3.0+v1.113.0
6.2.0+v1.113.0
6.1.4+v1.112.0
6.1.3+v1.111.1
6.1.2+v1.111.0
6.1.1+v1.110.0
6.1.0+v1.110.0
5.0.6+v1.100.0
6.0.2+v1.100.0
6.0.1+v1.100.0
6.0.0+v1.100.0
5.0.5+v1.100.0
5.0.5+1.25.3
5.0.4+v1.100.0
5.0.3+v1.100.0
5.0.2+v1.93.0
5.0.1+v1.93.0
5.0.0+v1.93.0
4.0.0+v1.93.0
3.9.1+v1.87.0
3.9.0+v1.87.0
3.8.0+v1.84.1
3.7.0+v1.82.0
3.6.0+v1.81.0
3.5.0+v1.81.0
3.4.0+v1.80.0
3.3.0+v1.78.0
3.2.0+v1.77.0
3.1.0+v1.76.0
3.0.0+v1.74.0
2.6.0+v1.74.0
2.5.0+v1.73.0
2.4.0+v1.72.0
2.3.0+v1.71.0
2.2.0+v1.68.0
2.1.0+v1.62.0
2.0.0+v1.58.1
1.3.0+v1.55.2
1.2.0+v1.52.0
1.1.0+v1.51.0
1.0.1+1.48.0
Labels
No items
No labels
Milestone
No items
No Milestone
Assignees
3wordchant
aadil (Aadil Ayub)
abra-bot (Abra Bot)
ammaratef45
amras (Sarma)
Apfelwurm
appletalk
arjan
basebuilder
BornDeleuze
Brooke
carla
cas (Cassowary)
codegod100
coopcloud
cyrnel
decentral1se (d1)
dede
devydave
fauno (fauno)
flancian
Frando
iexos
jade (Jade Ambrose)
javielico (Javielico)
jjsfunhouse
jmakdah2 (Jackie Makdah)
joe-irving (Joe Irving)
kawaiipunk (KawaiiPunk)
knoflook
kolaente
lambdabundesverband
linnealovespie (April)
marlon (marlon)
mayel
mirsal
moosemower
moritz
nicksellen (Nick Sellen)
notplants
oxaliq (sorrel)
p4u1
pau
pharaohgraphy (Andrew 🐦🔥❤️🔥✴️)
PhiNatalie
renovate-bot (Comrade Renovate Bot)
ripclap
rix
rscmbbng
sef (sef)
simon
sixsmith (Sixsmith)
stevensting
tobias
trav (Trav Fryer)
val (val (he/him))
vaznasty
virtualboys
wolcen (Chris Thompson)
wykwit
xynosis
yksflip
Clear assignees
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: coop-cloud/matrix-synapse#47
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Hello, I'm new to the coop-cloud ecosystem but was surprised to see this recipe includes an nginx container by default.
Looking at
nginx.conf.tmpl, it seems like the nginx container does the following:client_max_body_size=50M.well-known/matrix/serverand.well-known/matrix/clientwhich are used for delegationNumber 1 can be implemented with
traefik.http.middlewares.limit.buffering.maxRequestBodyBytes=50000000: https://doc.traefik.io/traefik/middlewares/http/buffering/And number 2 only seems to be required in some edge cases. Sounds like you only need to serve thoseEDIT: Using a different server_name hasn't been supported since the .well-known files nginx serves are never served from a different domain..well-knownfiles if 1) synapse is hosted on a subdomain, 2) your coop-cloud server is hosted on the root domain, and 3) you want usernames to reference the root domain and not the subdomain.If any of those three things are untrue, then it seems like the nginx container wouldn't be necessary. Is that common enough to be the default rather than in a separate
compose.delegation.yamlfile?Or if we don't want to change the defaults, should we add a
compose.no-nginx.yamlfile which uses!resetto remove the nginx service and sets the required labels to send traffic directly to synapse?Interested in your thoughts!
hey @mac-chaffee, you're most welcome and thanks for opening this issue! I originally implemented this without nginx but ended up including it because "privacy" #38 I would totally support the no-nginx version config (let's see if it complicates things tho) but it would be nice to have this warning about the IP tracking.
Hmm I did see that issue and was confused. All coop-cloud instances use traefik, right? Traefik indeed seems to send the x-forwarded-for header to backends by default, so if you can't make synapse stop saving those IPs, then that would be a problem. But I think we can tell traefik to stop setting that header like this:
There was some confusion online about whether this was possible, but seems like it should work as of traefik v2.10: https://github.com/traefik/traefik/pull/10132
Checking the dates on #38 and that v2.10 PR, I see that the feature was super new, maybe not even released yet. So I guess only now do we possibly have the powers to remove nginx, but we didn't back then!
@mac-chaffee nice detective work! If you wanna brave effort which can maintain functionality without nginx, be my guest! I imagine it might even be backwards compatible with existing deployments if you manage to do it well? You'd need to test it quite a bit tho. I don't maintain a synapse install anymore but I imagine other maintainers might have something to say here or could lend a hand. I'm not sure who that is atm but maybe the
git logwill show you and you can ping them.Feel free to re-open if work is proceeding.