问题
I am working on a MEAN stack SAAS application where I want to provide each user with their own unique subdomain. For example, I want the user John Doe to have the following subdomain to his name: johndoe.website.com.
The application is nearly ready pending this feature. I am looking for steps to accomplish this using NGINX and Node js in a manner that will lead to minimal changes to our existing code base.
I have searched the internet, and I was unable to find a resource that can serve as a step-by-step guide to help me solve this problem.
I know that the solution would involve the creation of Server Blocks to handle wildcard subdomains using NGINX, but I am not sure about the exact steps that will have to be implemented to get this done.
来源:https://stackoverflow.com/questions/61226187/how-to-create-handle-subdomains-on-the-fly-using-nginx-and-node-js