On my setup all working fine for my main domain section in config.json.
As I need more domains - using a config.json I configured another domain, "bvit", configured nginx for it and can open/access a login page for my extra MC domain which is https://bvit.domain.com.
As soon as I type username and password created for that domain - have an error "Unable to connect web socket, click to reconnect" - still can use main MC domain(https://main.domain.com), but error on extra domain does not disappear until whole MC server is restarted. Once MC server is restarted - same issue again on the extra domain.
Have checked couple of times my nginx configuration, all looks fine - and also if login page opens(can be accessed) for my extra domain, that should mean that nginx config is coorect.
Could you please help what is wrong on my extra domains.
nginx-main.domain.com.txt
nginx-sub1.domain.com.txt
MC-domain-secton.txt
Ok, I think I see the problem. In the config.json, add the following "dns" line to your second domain. Without it, MeshCentral expects the second domain to be accessible using "http://main.domain.com/bvit".
"domains": {
"": {
"ManageAllDeviceGroups": [ "admin","admin2" ],
"Title": "abc",
"Title2": "abc",
...
},
"bvit": {
"dns": "sub1.domain.com", <-----------------
"ManageAllDeviceGroups": [ "superadmin" ],
"Title": "abc bcc ",
"Title2": "abc bcc ",
...
}
},
Also, in the NGINX subdomain configuration, forward the incoming connections directly to "/" not to "/sub1". MeshCentral should look at the request header and be able to tell what domain the request is for.
That may be only part of the problem, but let me know we you get.
Thanks for checking. Will test it tomorrow and will post back.
So I made changes in both MC config.json and Nginx conf, but now no access to my sub1.domain.com
With NGINX conf changes from proxy_pass http://127.0.0.1:444/bvit/; to proxy_pass http://127.0.0.1:444/; when I try to open bvit.domain.com it loading my main remote.domain.com MC site. If I use Nginx as it was - with proxy_pass http://127.0.0.1:444/bvit/; result is "404 This page does not exist Go to main site"

On both tries - MC config.json is with "dns": "bvit.domain.com",
@Ylianst Just a small update - I reverted settings to same as in 1st port and created a new subdomain with no users created for this domain. I managed to access newly created domain and to fill in details for first user(to created a new admin user) on the login page on new subdomain. Straight after user creation I received same error "Unable to connect web socket, click to reconnect".
Strange is that the username which I created on login page is appeared on the main domain in Users section.... So sub1.domain.com can create a new user for it from login page, but cannot login.
Hope that will help to investigate where is the problem.
On inspect element when I open sub1.domain.com css is loaded from https://sub1.domain.com/styles/style.css, but after entering username and password, wss is pointing to wss://sub1.domain.com/sub1/control.ashx?auth=AGyo0vjpIbFnVpBuuLxxxxxxxxxxxxxxxxxxxxx. So looks like in the link additional /sub1/ after domain name is the problem, or it should work that way?
Also on browser inspect element in Console tab it shows GET https://sub1.domain.com/sub1/commander.htm [HTTP/1.1 404 Not Found 11ms]
Finally managed to get it working!!!!!!!!!!!!!!!!
Somehow it started working with all @Ylianst suggestions!!!!!
Strange that all configurations are same as before?!?!??!?!
The only difference is that I have restarted NGINX and after that MC Server.
So looks like when NGINX needs restart, MC server have to be stopped, or also restarted on every NGINX restart.
Simple issue, butt took me a months to figure it out. Thanks again for all help!!!!