Traffic control per subdomain

Hi guys
Currently, I have the following setup:

defaults
log global
mode http
retries 3
balance roundrobin
option abortonclose
option redispatch
contimeout 10000
clitimeout 150000
srvtimeout 300000
maxconn 500000

But I want to limit the number of simultaneous accesses per subdomain.
For example, say the limit is 500 active connections per subdomain:

a.mysite.com → 500 active connections
b.mysite.com → 500 active connections
c.mysite.com → 499 active connections

If someone tries to access either “a” or “b”, they won’t be allowed.
But it’s OK if someone tries to access “c”.

Thanks in advance.