I need to create and remove subdomains automatically using nginx. I know I can do it using the following approach:
server {
listen 80;
server_name example.com *.example.com;
root /var/www/example.com/$subdomain;
set $subdomain "";
if ($host ~* ^([a-z0-9-\.]+)\.example.com$) {
set $subdomain $1;
}
if ($host ~* ^www.example.com$) {
set $subdomain "";
}
}
I can create folders in root /var/www/example.com/ using a script and nginx will create appropriate subdomains for me.
However I need to set such parameters as number of simultaneous connections and maximum connection bandwidth and values of that parameters will be passed to my script.
So the question is how can I set those additional parameters?
If there's no way to solve my problem using nginx you can advice me how to solve it using apache.
Thanks!