Issue Description
Actually, I have my mail server running with Stalwart which is behind an reverse proxy (nginx).
This reverse proxy is working on another server.
So basically the http and https flux are working like this :
Client → NGINX Reverse Proxy (server) → Mail Server
But when I’ve installed Stalwart, the access to the mail dashboard in https worked fine.
And since two day, idk why but I’m getting error 502 : Gateway error from my nginx server.
After looking on the logs, here are the errors :
2026/07/18 00:06:29 [error] 18856#18856: *183933 peer closed connection in SSL handshake (104: Connection reset by peer) while SSL handshaking to upstream, client: <redacted>, server: mail.my-server.fr, request: "GET / HTTP/2.0", upstream: "https://192.168.12.10:443/", host: "mail.my-server.fr"
2026/07/18 00:06:29 [error] 18856#18856: *183933 peer closed connection in SSL handshake (104: Connection reset by peer) while SSL handshaking to upstream, client: <redacted>, server: mail.my-server.fr, request: "GET /favicon.ico HTTP/2.0", upstream: "https://192.168.12.10:443/favicon.ico", host: "mail.my-server.fr", referrer: "https://mail.my-server.fr/"
I’ve tryed a few times to resolve this issue (even with the help of AI) but I can’t find how to resolve it.
Expected Behavior
I need to be able to acces the web dashboard of the mail server running with Stalwart.
Actual Behavior
I’m getting error 502 : Gateway error from my reverse proxy (nginx)
Relevant Log Output
2026/07/18 00:06:29 [error] 18856#18856: *183933 peer closed connection in SSL handshake (104: Connection reset by peer) while SSL handshaking to upstream, client: <redacted>, server: mail.my-server.fr, request: "GET / HTTP/2.0", upstream: "https://192.168.12.10:443/", host: "mail.my-server.fr"
2026/07/18 00:06:29 [error] 18856#18856: *183933 peer closed connection in SSL handshake (104: Connection reset by peer) while SSL handshaking to upstream, client: <redacted>, server: mail.my-server.fr, request: "GET /favicon.ico HTTP/2.0", upstream: "https://192.168.12.10:443/favicon.ico", host: "mail.my-server.fr", referrer: "https://mail.my-server.fr/"
Stalwart Version
v0.16.x
Installation Method
Binary (Linux)
Database Backend
RocksDB
Blob Storage
RocksDB
Search Engine
Internal
Directory Backend
Internal
Additional Context
I’m actually running a separate reverse proxy with all the configuration to access all my websites and services.
The Nginx version is : 1.28.3
Both the nginx dedicated server and mail server are running on Ubuntu 26.04 LTS.
I’ve configured the env variable : STALWART_HOSTNAME and STALWART_PUBLIC_NAME to the same domain name.
I have reviewed the documentation and FAQ and confirm that my issue is NOT addressed there.
on
I have searched this support forum (open and closed topics) and confirm this is not a duplicate.
on
I understand that topics in this category are triaged by a bot first but a human reply will follow up. If I’d prefer a human-only reply, I’ll add the no-ai tag to my topic.
on

