Robert Mueller
January 21, 2010 10:04PM
> what i'm trying to do is limit the bandwith for each user that i have in
> a mysqlDB for some mp3.

You might be able to look at the postaction handler. We have something
like this:

location /xyz {
...
proxy_hide_header X-Rate-User;
post_action @ratepostaction;
}

location @ratepostaction {
set $rateuser $upstream_http_x_rate_user;
proxy_set_header RateUser $rateuser;
proxy_set_header RateURI "$host$request_uri";
proxy_set_header RateBytes $body_bytes_sent;
proxy_set_header RateIP $remote_addr;
proxy_set_header RateStatus $upstream_status;
proxy_pass_request_body off;
proxy_pass_request_headers off;
proxy_pass http://unix:/var/state/ratetrack/ratepostaction:;
}

To track used bandwidth for each user. The backend sets the X-Rate-User
header in the response, and there's a separate daemon running that
listens on /var/state/ratetrack/ratepostaction to receive the rate data
events.

I'm not sure how this interacts with NginxXSendfile though...

Rob

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

limiting bandwith by querying mysql possible?

partysoft December 07, 2009 11:43PM

Re: limiting bandwith by querying mysql possible?

Piotr Sikora December 07, 2009 11:56PM

Re: limiting bandwith by querying mysql possible?

partysoft January 19, 2010 12:08AM

Re: limiting bandwith by querying mysql possible?

Piotr Sikora January 20, 2010 02:10AM

Re: limiting bandwith by querying mysql possible?

agentzh January 19, 2010 08:56PM

Re: limiting bandwith by querying mysql possible?

Robert Mueller January 21, 2010 10:04PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 259
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready