Sorry for the vague title. Let me elaborate. I do not know the keywords for this so I couldn't Google this.
Imagine mydomain.com is a platform where people could come in and generate their contents. They could create their own pages and each of their page is to be mapped to xxx.mydomain.com.
so suppose there is a user named "John Doe" and his ID is 222, you can access his page via john-doe.mydomain.com . Currently, my web app already has something like mydomain.com/userpage/john-doe-222.
Is it possible to dynamically map the former URL to the latter URL in NGINX without restarting? I would like to make it so the users could even change their own xxx.mydomain.com freely as well. Is such functionality possible in NGINX? How to proceed in this case? Thank you.