Auth rate limits not working on a VPS Deployment (Coolify/Dokploy)

I am facing an issue where auth rate limits work perfectly in both dev and prod builds, but once deployed on a VPS using Coolify/Dokploy, they stop functioning. Users can bypass the rate limits entirely. I would appreciate any help on what might be causing this. @bekacru
No description
8 Replies
bekacru
bekacru2mo ago
I can't tell without more context but most likely it's due to storage. If you need a proper rate limiting I suggest providing a secondary storage instead of relying on memory.
Shambhu Tiwary
Shambhu TiwaryOP2mo ago
I was now going to add secondary storage. Is there a way to somehow log the rate limits yet?
bekacru
bekacru2mo ago
you can provide custom storage directly in the rateLimit config. Which you can use to log what is being stored.
Shambhu Tiwary
Shambhu TiwaryOP2mo ago
thanks so much!
Shambhu Tiwary
Shambhu TiwaryOP2mo ago
@bekacru the rate limit doesnt work on the server even after I use database as storage.
No description
No description
Shambhu Tiwary
Shambhu TiwaryOP2mo ago
On Serverless its fine. But on a VPS it adds the APP_URL as https://localhost:3000 after the IP in key for some reason. and it doesnt ratelimit and the count can just keep increasing. I have shared the screenshot above for reference.
bekacru
bekacru2mo ago
will be fixed on the next release. the issue is interally on vps req.url is set to localhost
Shambhu Tiwary
Shambhu TiwaryOP2mo ago
Thanks for all the hardwork!

Did you find this page helpful?