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?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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