In the background, bench start initiates a simple werkzeug server for your default site. If you have other sites on the same host, they will not be served.
I suspect you could run the command more than once in different terminal sessions to serve different sites, but I’ve never tried it. Generally speaking, bench start is intended only for development. For multiple tenants, you would usually set up a production deployment (which includes nginx and supervisorctl).
Edited: Looks like my understanding was incorrect! See @revant_one’s correct answer below
bench start will serve all sites as long as currentsite.txt is not configured.
I create sites like: site1.localhost, site2.localhost, siteN.localhost, I can access them via hostname like: http://siteN.localhost:8000, http://site2.localhost:8000
Thanks, Revant, for your answer. I always follow your contribution to this community.
I have a question regarding this. In development, is it possible to serve more than one site using hostname only? I tried this without luck. I always have to specify the port, for example: site1.com:8000 and site2.com: 8001
How would I configure nginx and Procfile to serve two sites using their hostname and the default http port 80 concurrently?
You could do it manually or … as a trick … configure production environment for DNS based multisite. It will adjust nginx.conf, create symlinks properly, etc … Then disable production and run bench start.
Actually, that what I was doing. I have enabled the error logs of nginx and realized that the issue is with the permission. Looks like the command bench setup production sets some special permission for nginx to be able to communicate with the server.
I will try to figure out how to handle the permission for the below error logs from the nginx error log file: