Running synapse without nginx #47
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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/server
and.well-known/matrix/client
which 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-known
files 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.yaml
file?Or if we don't want to change the defaults, should we add a
compose.no-nginx.yaml
file which uses!reset
to 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 a 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 ahnd. I'm not sure who that is atm but maybe the
git log
will show you and you can ping them.