mirror of
https://github.com/stoatchat/self-hosted.git
synced 2026-07-20 20:16:47 -04:00
Reverse Proxy guide is wrong #115
Reference in New Issue
Block a user
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?
Originally created by @caiot5 on GitHub (Aug 4, 2025).
I cannot use Revolt when using a Reverse Proxy like Nginx Proxy (configured via NPM).
I have many domains already setup so I know it isn't an issue with the NPM itself.
Revolt is running in a VM with the local IP 192.168.5.18 on port 80, I've used the generate_config.sh and the only change I did was to change the HOSTNAME= on .env.web to HOSTNAME=:80 (as your guide guidelines for proxy) but I cannot log in, it tells me to see the error on console and when I do, I see nothing useful.
All other URLs are (as I've set up with generate_config.sh) set to https://mydomain.tld or wss://mydomain.tld
Before I try to log in, I see some errors like:
database-1 | {"t":{"$date":"2025-08-04T17:29:20.925+00:00"},"s":"I", "c":"NETWORK", "id":22944, "ctx":"conn19","msg":"Connection ended","attr":{"remote":"127.0.0.1:45300","isLoadBalanced":false,"uuid":{"uuid":{"$uuid":"4151f387-efe1-4681-ae38-f35c14957b51"}},"connectionId":19,"connectionCount":13}}
database-1 | {"t":{"$date":"2025-08-04T17:29:20.926+00:00"},"s":"I", "c":"NETWORK", "id":22944, "ctx":"conn22","msg":"Connection ended","attr":{"remote":"127.0.0.1:45330","isLoadBalanced":false,"uuid":{"uuid":{"$uuid":"ddc36f75-6cf9-412d-bc2b-a5b8dc38c352"}},"connectionId":22,"connectionCount":12}}
Then on console I see:
api-1 | INFO rocket::server > OPTIONS /auth/session/login:
api-1 | INFO rocket::server::_ > Matched: OPTIONS /<catch_all_options_route..> [9223372036854775807]
api-1 | INFO rocket_cors::_ > "Catch all" handling of CORS
OPTIONSpreflight for request OPTIONS /auth/session/loginapi-1 | INFO rocket::server::_ > Outcome: Success(200 OK)
api-1 | INFO rocket::server::_ > Response succeeded.
api-1 | INFO rocket::server > POST /auth/session/login application/json:
api-1 | INFO rocket::server::_ > Matched: (login) POST /auth/session/login
api-1 | INFO rocket::server::_ > Outcome: Success(200 OK)
api-1 | INFO rocket::server::_ > Response succeeded.
api-1 | INFO rocket::server > OPTIONS /onboard/hello:
api-1 | INFO rocket::server::_ > Matched: OPTIONS /<catch_all_options_route..> [9223372036854775807]
api-1 | INFO rocket_cors::_ > "Catch all" handling of CORS
OPTIONSpreflight for request OPTIONS /onboard/helloapi-1 | INFO rocket::server::_ > Outcome: Success(200 OK)
api-1 | INFO rocket::server::_ > Response succeeded.
api-1 | INFO rocket::server > GET /onboard/hello application/json:
api-1 | INFO rocket::server::_ > Matched: (hello) GET /onboard/hello
api-1 | INFO rocket::server::_ > Outcome: Success(200 OK)
api-1 | INFO rocket::server::_ > Response succeeded.
api-1 | INFO rocket::server > GET /onboard/hello application/json:
api-1 | INFO rocket::server::_ > Matched: (hello) GET /onboard/hello
api-1 | INFO rocket::server::_ > Outcome: Success(200 OK)
api-1 | INFO rocket::server::_ > Response succeeded.
database-1 | {"t":{"$date":"2025-08-04T17:31:21.842+00:00"},"s":"I", "c":"NETWORK", "id":22943, "ctx":"listener","msg":"Connection accepted","attr":{"remote":"127.0.0.1:32832","isLoadBalanced":false,"uuid":{"uuid":{"$uuid":"7591d158-2820-486a-9d21-bf543a7bfd3f"}},"connectionId":69,"connectionCount":10}}
database-1 | {"t":{"$date":"2025-08-04T17:31:21.847+00:00"},"s":"I", "c":"NETWORK", "id":51800, "ctx":"conn69","msg":"client metadata","attr":{"remote":"127.0.0.1:32832","client":"conn69","negotiatedCompressors":[],"doc":{"application":{"name":"mongosh 2.5.6"},"driver":{"name":"nodejs|mongosh","version":"6.16.0|2.5.6"},"platform":"Node.js v20.19.4, LE","os":{"name":"linux","architecture":"x64","version":"3.10.0-327.22.2.el7.x86_64","type":"Linux"},"env":{"container":{"runtime":"docker"}}}}}
database-1 | {"t":{"$date":"2025-08-04T17:31:21.910+00:00"},"s":"I", "c":"NETWORK", "id":22943, "ctx":"listener","msg":"Connection accepted","attr":{"remote":"127.0.0.1:32848","isLoadBalanced":false,"uuid":{"uuid":{"$uuid":"59144e8a-5b73-41c5-b753-a346b3678687"}},"connectionId":70,"connectionCount":11}}
database-1 | {"t":{"$date":"2025-08-04T17:31:21.911+00:00"},"s":"I", "c":"NETWORK", "id":22943, "ctx":"listener","msg":"Connection accepted","attr":{"remote":"127.0.0.1:32858","isLoadBalanced":false,"uuid":{"uuid":{"$uuid":"6c652f33-1018-4bfa-87ad-a2349d8ff1f0"}},"connectionId":71,"connectionCount":12}}
database-1 | {"t":{"$date":"2025-08-04T17:31:21.912+00:00"},"s":"I", "c":"NETWORK", "id":51800, "ctx":"conn70","msg":"client metadata","attr":{"remote":"127.0.0.1:32848","client":"conn70","negotiatedCompressors":[],"doc":{"application":{"name":"mongosh 2.5.6"},"driver":{"name":"nodejs|mongosh","version":"6.16.0|2.5.6"},"platform":"Node.js v20.19.4, LE","os":{"name":"linux","architecture":"x64","version":"3.10.0-327.22.2.el7.x86_64","type":"Linux"},"env":{"container":{"runtime":"docker"}}}}}
database-1 | {"t":{"$date":"2025-08-04T17:31:21.914+00:00"},"s":"I", "c":"NETWORK", "id":51800, "ctx":"conn71","msg":"client metadata","attr":{"remote":"127.0.0.1:32858","client":"conn71","negotiatedCompressors":[],"doc":{"application":{"name":"mongosh 2.5.6"},"driver":{"name":"nodejs|mongosh","version":"6.16.0|2.5.6"},"platform":"Node.js v20.19.4, LE","os":{"name":"linux","architecture":"x64","version":"3.10.0-327.22.2.el7.x86_64","type":"Linux"},"env":{"container":{"runtime":"docker"}}}}}
database-1 | {"t":{"$date":"2025-08-04T17:31:21.918+00:00"},"s":"I", "c":"NETWORK", "id":6788700, "ctx":"conn70","msg":"Received first command on ingress connection since session start or auth handshake","attr":{"elapsedMillis":5}}
database-1 | {"t":{"$date":"2025-08-04T17:31:21.924+00:00"},"s":"I", "c":"NETWORK", "id":22943, "ctx":"listener","msg":"Connection accepted","attr":{"remote":"127.0.0.1:32862","isLoadBalanced":false,"uuid":{"uuid":{"$uuid":"ea761e26-3434-4dbd-b30e-4652d78c1bb8"}},"connectionId":72,"connectionCount":13}}
database-1 | {"t":{"$date":"2025-08-04T17:31:21.930+00:00"},"s":"I", "c":"NETWORK", "id":51800, "ctx":"conn72","msg":"client metadata","attr":{"remote":"127.0.0.1:32862","client":"conn72","negotiatedCompressors":[],"doc":{"application":{"name":"mongosh 2.5.6"},"driver":{"name":"nodejs|mongosh","version":"6.16.0|2.5.6"},"platform":"Node.js v20.19.4, LE","os":{"name":"linux","architecture":"x64","version":"3.10.0-327.22.2.el7.x86_64","type":"Linux"},"env":{"container":{"runtime":"docker"}}}}}
database-1 | {"t":{"$date":"2025-08-04T17:31:21.932+00:00"},"s":"I", "c":"NETWORK", "id":6788700, "ctx":"conn72","msg":"Received first command on ingress connection since session start or auth handshake","attr":{"elapsedMillis":1}}
database-1 | {"t":{"$date":"2025-08-04T17:31:22.312+00:00"},"s":"I", "c":"NETWORK", "id":22944, "ctx":"conn69","msg":"Connection ended","attr":{"remote":"127.0.0.1:32832","isLoadBalanced":false,"uuid":{"uuid":{"$uuid":"7591d158-2820-486a-9d21-bf543a7bfd3f"}},"connectionId":69,"connectionCount":12}}
The configuration files are as below (I hid the secret keys and the domain for security reasons):
.env.web file:
HOSTNAME=:80
REVOLT_PUBLIC_URL=https://my.beautiful.domain.tld/api
Revolt.toml file:
[hosts]
app = "https://my.beautiful.domain.tld"
api = "https://my.beautiful.domain.tld/api"
events = "wss://my.beautiful.domain.tld/ws"
autumn = "https://my.beautiful.domain.tld/autumn"
january = "https://my.beautiful.domain.tld/january"
[pushd.vapid]
private_key = "THE.SECRET.PRIVATE.KEY"
public_key = "THE.SECRET.PUBLIC.KEY"
[files]
encryption_key = "THE.SECRET.ENCRYPTION.KEY"
I even tried to get Revolt.toml file and just replace the hosts default values from the ones generated by your bash script but same thing.
To test if was something wrong with the proxy I tried to change my /etc/hosts (locally) to point directly to the VM and even though I have the same errors, something seems wrong.
@caiot5 commented on GitHub (Aug 4, 2025):
Ok, after many trials and errors I finally managed to get revolt up and running with the external nginx proxy and SSL (looks like it was the CPU-TYPE on the Virtual Machine due to the use of a mongoDB database which requires a specific extension)
However, now I found an actual bug:
If I delete my own account and try to register it again (with the same email address), it gives me Operation Failure in the front-end and on the backend :
api-1 | INFO rocket::server > POST /auth/account/create application/json:
api-1 | INFO rocket::server::_ > Matched: (create_account) POST /auth/account/create
api-1 | INFO rocket::server::_ > Outcome: Success(500 Internal Server Error)
api-1 | INFO rocket::server::_ > Response succeeded.
Looks like the application is giving error 500.
Do you want me to close this issue as finished (since we found that the error was due a lacking exposed extension to the VM) and open another one with this error?
@seva-luchianov commented on GitHub (Feb 11, 2026):
I think I'm having the same issue? Using nginx for reverse proxy on ubuntu 26.04
What exactly did you tweak to fix this?
My nginx conf looks like this so far
I originally hit this issue https://github.com/stoatchat/self-hosted/issues/168 but fixed it from suggestions in that thread.
@seva-luchianov commented on GitHub (Feb 11, 2026):
To be specific - I can log in, but am immediately hit with
and that caddy error.
@caiot5 commented on GitHub (Feb 12, 2026):
In my case it was due to the database not being able to come up and the reason behind that is because they;re using mongodb and recent mongodb needs specific CPU instructions which were not passed through in my hypervisor (proxmox) by default, so I had to change the cpu-type to host to make sure it exposes everything and voila. I only kept this bug open was due the other error Ive found which is reported here as well...
@seva-luchianov commented on GitHub (Feb 12, 2026):
Ah perhaps we have a different issue after all. I know my instance can access the mongodb since I was able to use invite codes to register users successfully. Seems like I have a different issue with the reverse proxy just falling apart on the caddy side but I have no idea how to troubleshoot from here...
@JJandPenguin commented on GitHub (Feb 12, 2026):
im having the same issue here, except on my end its because cloudflared keeps trying to pass along ws instead of wss, but idk how to fix that ive tried changing it to mss on the back end side and that jut seemed to broke things. any idea on how i can fix this?