Subdomains and folders / directories

I am currently creating a web application and I would like my users to have their own URLs to identify them. I could do this using subdomains or using folders, and I wonder what advantages and disadvantages they have.

I really like the folder solution because my URL mapping will be pretty simple. I read about auto-generating subdomains, and one solution was to create virtual hosts and then restart my nginx. This is a solution, but I would prefer not to restart my web server every time a new account is created. If there are any other ways to create automated subdomain creation, that would be great!

Thank!

+3
source share
2 answers

I think directories are the way to go. I believe that it would be easier to adapt Django to directories much easier than to subdomains. And as one user commented, you can restart the server each time.

I prefer to keep subdomains reserved for use on the system. Instead, users should get their own directories. This is not a rule, just my preference.

+1
source

Use something like mod_wsgi instead of cgi scripts, they allow you to use arbitrary URL configurations (for example: Django, web.py, Zope ...)

0
source

Source: https://habr.com/ru/post/1763493/


All Articles