So I've set up NGINX to serve static websites per user on GNU/Linux Debian 8, using the following naming convention:
Each user's public web folder is located in their respective home directory, and that's also where they will be expected to keep their Node.js projects.
This is all well and good, however, how can I keep different users from starting projects that use colliding port numbers on the same domain? Or more succintly, how can I force each user to use just one unique port number in Node.js? Or do I even need to? Can a user's instance of Node.js be captured somehow, and then translated into something adhering to the above naming convention? If so, how?
Example: If user JSmith makes a website using Node.js and runs it, the website should be published to
www.example.com/~jsmith no matter what other domain or port settings JSmith used in his Node.js application.