I figured it out, here's what was happening:
The client was trying to access the SSO redirect URL with HTTP, but my server was configured to use HTTPS:
Requested URI http://matrix.due.ren/_matrix/client/r0/login/sso/redirect/oidc-cloudron?redirectUrl=element://connect?transaction_id=m2111693422.2 is not canonical: redirecting to https://matrix.due.ren/_matrix/client/r0/login/sso/redirect/oidc-cloudron?redirectUrl=element://connect?transaction_id=m2111693422.2
This redirection kept happening repeatedly (as shown by the multiple identical log entries with different request IDs), creating a loop. Synapse didn't properly handle the protocol conversion between HTTP and HTTPS.
Here's how I fixed the issue:
Added the x_forwarded: true setting to my configuration's listeners section:
listeners:
- port: 8008
type: http
bind_addresses: ['0.0.0.0']
x_forwarded: true # Added this line
resources:
- names: [client, federation, metrics]
compress: false