I need to throttle upload/download speed based on whether a user is logged in or not for my application. I'm using nginx and Django. Is there a way for me to do this?
This is the job of a load balancer instead of django or nginx.
You can setup two zones with nginx and limit the bandwidth on one and not on the other. You can direct logged in users to the unlimited zone on nginx and anon users to the limited zone.
This module lets you limit on a per-ip basis: https://github.com/trbs/Nginx-limit-traffic-rate-module
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With