I am planning to limit user bandwidth. I came across post_action directive in core module and thinking if I can get response size served by nginx and send it to code using post_action.

Any ideas how can I do that?


nginx sets its $body_bytes_sent variable to the size of the HTTP response.

| improve this answer | |

There's a built-in solution to limit user bandwith in the HttpCoreModule of nginx. Let's say for example that you want to limit bandwith to 20kB/s:

set $limit_rate 20k;
| improve this answer | |
  • I want to limit bandwidth per user per month – Naveed Nov 29 '12 at 8:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.