Access dashboard from private openhab cloud

Hello,
I’m trying to setup a private openhab cloud, but I’m struggling on some things…

The main issue I run into at the moment, is to access my oh3 dashboard through the cloud, and I don’t understand how it’s supposed to work! When I install oh-cloud following the github’s documentation (setting aside nginx for the moment) I end up with ohc running on port 3000 as expected. When I connect & login, I’m greeted with “Your openHAB is online. Click here to access your openHAB’s dashboard” giving a link to the exact same url (/mydomain:3000/).

By looking into the issue both on github & here, I found out the property “proxyHost” that can be set into the config.json to point to a different host. My understanding for this is that older versions of oh used sub-folders for UI, so you could just called mydomain:3000/subfolder and it worked, but as oh3 uses the root, it has to be on a different domain for the application to understand we’re looking for the dashboard and not the main ui.
So far so good, but! How is it supposed to work? Am I just supposed to add a vhost that proxy home.mydomain.com to localhost:3000? I’ve tried it, and it didn’t seem to work. I ended up on the main page even when accessing through the domain configured in the ‘proxyHost’

! Important note ! Sometime I don’t like to do what I’m told, so for all my vhost tests I’ve been using apache2 and not nginx. But I don’t see why it wouldn’t work?

So I tried to investigate a bit more. And I found this: openhab-cloud/etc at master · openhab/openhab-cloud · GitHub
More specifically nginx_openhabcloud-production.conf, openhabcloud-main@.service and openhabcloud-web@.service. In the nginx configuration, I can see that the myopenhab and home.myopenhab do not proxy to the same destination. One to 3000, and the other to 3001. And in the service definitions, two services! One with TASK=web and one with TASK=main.
Is there any untold story that we need to run 2 instances of the app, one for the main, one for the dashboards? Or is it just a deployment choice for myopenhab?
! Note ! I tried to run another instance with PORT=3001 TASK=web because why not, and it didn’t work any better!

So yeah, I’m kind of stuck now. Any idea what my issue is? Is there something missing somewhere? Is it just “supposed to work as is” and then the issue is me using apache instead of nginx?

Thanks!

Well, I just tried with nginx, and as I expected I end up with the exact same result. I just don’t understand how it’s supposed to work with the information that are provided…

Ok I found the issue… but I must say it’s quite… ugly…

The redirect only works with the subdomain starts with “remote.” or “home.”. My subdomain was different…
Sorry for the post I guess

1 Like

but didn’t you write in your first post that you tried home.mydomain.com ?

Yes sorry. I wanted to anonymize my domain so I replaced it with “what would be expected”. Never would I have imagined that the subdomain name was a hardcoded string in the app’s code…