Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

matrix-synapse: fix documentation #63639

Merged
merged 1 commit into from Jul 13, 2019
Merged

Conversation

Ekleog
Copy link
Member

@Ekleog Ekleog commented Jun 22, 2019

cc @jtojnar @florianjacob from the git blame.

My synapse deployment would work properly only with this change, but pinging you to check whether you have the same thing or it's some other configuration difference that forced me to add that. :)

@jtojnar
Copy link
Contributor

jtojnar commented Jun 22, 2019

I only touched the manual for cleanups and do not run Synapse but it looks to me like a typo.

@peterhoeg
Copy link
Member

I'm running a synapse instance without the proposed change - works swimmingly.

@florianjacob
Copy link
Contributor

I run it without the suffix as well, and took it from the official documentation: https://github.com/matrix-org/synapse/blob/master/docs/reverse_proxy.rst

@Ekleog My guess would be that you don't have the proxy_set_header X-Forwarded-For $remote_addr; as in the upstream documentation and this is what's allowing nginx to work without the suffix. This header line is added by having services.nginx.recommendedProxySettings = true;, do you have that setting? I admit though that the block of recommended*Settings in the manual is easy to miss, and it probably doesn't get across that Proxy and Gzip are really not optional for the whole thing to work.

@Ekleog
Copy link
Member Author

Ekleog commented Jun 26, 2019

@florianjacob Unfortunately, I do have it set to true, and nixos-option services.nginx.recommendedProxySettings confirms my config file, so something else must be at play. I'm on 19.03, which is on 0.99.1.1, maybe there is a link with something changing between versions?

@peterhoeg
Copy link
Member

I'm on 19.03, which is on 0.99.1.1, maybe there is a link with something changing between versions?

I doubt it. I have been running it since the 0.2x.y days and running on 1.0.0 on 19.03.

@Ekleog
Copy link
Member Author

Ekleog commented Jun 27, 2019

That is weird. I've just checked my configuration, and in stuff that should concern synapse, the differences are:

  • I set the virtualHosts.*.listen option so that nginx listens on only one of my two IPs
  • I add proxyWebsockets = true alongside proxyPass = "..." (not sure it's required but it was there since a long time ago, so I guess it may be useful for something, and shouldn't break stuff
  • I use ipv4 localhost instead of ipv6, both in proxyPass and in matrix-synapse.listeners.0.bind_address (old-fashioned me)
  • I have matrix-synapse.public_baseurl set

None of these should, AFAIU, be able to change the observable behavior. At this stage I can see little options other than some weird upstream bug that I don't have time to track for now.

@peterhoeg Can I ask you to test on your server with the /_matrix addition? If it works for you too maybe it's better to just document the way that appears to work for everyone until the “why” can be sorted out?

@peterhoeg
Copy link
Member

It still works here if I add the /_matrix.

@Ekleog Ekleog merged commit 8f38f03 into NixOS:master Jul 13, 2019
@florianjacob
Copy link
Contributor

Just stumbled over this change in the synapse nginx documentation referencing a thing called “nginx uri canonicalization / normalization” - @Ekleog you did not have a trailing slash sneaking into your proxy_pass, did you? ;)

Generally we should write an integration test for the full setup described in the manual, for cases like this as a reproducible foundation to be able to split apart side effects from people's specific setups and actual bugs in the manual / software, and to detect breakage on updates of the related software.
My perl and general knowledge of NixOS testing facilities is bad, but I guess I'll eventually try that if no one else is faster.

@Ekleog
Copy link
Member Author

Ekleog commented Jul 25, 2019

Looking up my git history, I totally had a / that sneaked in. Thank you! Just pushed 5f33bcd to rollback this change and make the need for absence of the / explicit :)

@florianjacob
Copy link
Contributor

@Ekleog Great, I'm glad we were able to find the root cause. :) 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants