-
This is probably a bug, but since I'm new to working with Stalwart and I'm using it in a configuration other than the recommended one (see below), I'm posting it as a question. We can move this to an issue if need be. I have the following configuration:
JMAP doesn't work. The issue appears to be the following: "$ curl -s https://mail.maildomain.tld/.well-known/oauth-authorization-server | jq"
{
"issuer": "http://mail.mydomain.tld:8443",
"token_endpoint": "http://mail.mydomain.tld:8443/auth/token",
"grant_types_supported": [
"authorization_code",
"implicit",
"urn:ietf:params:oauth:grant-type:device_code"
],
"device_authorization_endpoint": "http://mail.mydomain.tld:8443/auth/device",
"response_types_supported": [
"code",
"code token"
],
"scopes_supported": [
"offline_access"
],
"authorization_endpoint": "http://mail.mydomain.tld:8443/authorize/code"
} As you can see, these URLs have the correct domain and path, but use the internal port and protocol (http) rather than the correct external address outside of the proxy: I'm guessing (but I have no way to know for sure) that using the proxy protocol would provide Stalwart with the information it needs about the external interface of the reverse proxy, and that's why no one else (I could find) has reported this issue. Maybe, despite the presence of the X-Forwarded-For header, Stalwart is assuming it's not behind a proxy because there are no "trusted" networks. I know similar applications that run behind proxies often provide a configuration option to manually set the public URL of the server, but I didn't see anything like this in the documentation. Side note: why I'm setting up Stalwart like thisNginx's support for the proxy protocol is a lot more limited than I initially hoped. Nginx supports multiple server blocks all listening on the same port and selects the correct server blocks automatically (using SNI). It's common to have a bunch of different sites all hosted at the same IP:PORT combination. Unfortunately, Nginx does not support the proxy protocol in the context of these So I've decided to stick to the approach I'm used to, and handle the TLS and proxy settings in Nginx explicitly. It works great other than the issue I've described here. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Have you updated your URL expression? |
Beta Was this translation helpful? Give feedback.
Have you updated your URL expression?