Considering I have something like this:
/sites/foo/a1
/sites/foo/a2
/sites/foo/a3
/sites/bar/b1
/sites/bar/b2
And I want to access them like this:
foo.a1.mydomain.com
or (if the last one doesn't work)
foo-a1.mydomain.com
How can I create virtual hosts dynamically in nginx, to accept going to those folders?