Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

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

share|improve this answer
add comment

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;
share|improve this answer
    
I want to limit bandwidth per user per month –  cmnajs Nov 29 '12 at 8:30
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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