Need help understanding openHab cloud redirection setup,

Hello all,

I’ve setup a private openhab cloud instance on my computer to be able to develop on openhab cloud and better understand how openhab cloud work internally.

My setup is working ok, and I can now access openhab cloud using https://myopenhab.mydomain.net.
My instance show online in openhab cloud.
Nginx is also setup as frontend on this computer, and handle request ok.

What I try to achieve now is make the redirection to openhab instance work as well (the one you trigger poiting to https://home.myopenhab.mydomain.net).

But I don’t undestand how top setup this.
In the sample config file nginx_openhabcloud-production.conf, there is a dedicated section for home.myopenhab.org

server {
listen 443 ssl;
server_name home.myopenhab.org;

This section proxy request to socketapp :slight_smile:

location / {
proxy_pass http://socketapp;
proxy_redirect off;

where socketapp is defined as:

upstream socketapp {
server 192.168.158.18:3001;
}

What I don’t undestand is the 3001 port ?
My openhab cloud node instance only listenning on port 3000.

Do I need to add some extra configuration in my config.json to make this work ?

Help would be appreciate on this.

Laurent.

I reply to myself.
Find the following interesting post :

Not read all the post so far, but Iwas finally able :slight_smile:

Laurent.

I haven’t checked again, but as far as I remember the server configuration in the thread is the one I’m currently running. So you should be able to get the system running :slight_smile:

I think I find how to fix my setup.
There seems to be a “proxyHost” configuration that need to be add to the config.json in system section.
Something like “proxyHost”: “home.myopenhab.mydomain.net”.

I currently testing this :slight_smile:

My current config.json is this (firebase not working though)

{
    "system": {
        "host": "openhab.mydomain.de",
	    "proxyHost": "home.mydomain.de",
        "listenIp": "0.0.0.0",
        "port": "443",
        "protocol": "https",
        "base_url": "https://openhab.mydomain.de",
        "openhab_url": "https://home.mydomain.de",
        "logger" : {
            "dir": "./logs",
            "maxFiles" : "7d",
            "level" : "debug",
            "morganOption" : "dev"
          }
    },
    "express":{
      "key" : "some express key"
    },
    "mongodb": {
        "hosts": ["127.0.0.1"],
        "db": "openhab"
    },
    "redis": {
        "host": "127.0.0.1",
        "port": "6379"
    },
    "mailer": {
        "host" : "mydomain.de",
        "port": 465,
        "secureConnection": true,
        "user": "openhab@mydomain.de",
        "password": "Password",
        "from": "openhab@mydomain.de"
    },
    "firebase": {
    	"apiKey": "AIzaSyAbchangeBeGm_it_6A3MOhereosf95qM",
    	"authDomain": "openhab-notification-mydomain.firebaseapp.com",
    	"projectId": "openhab-notification-mydomain",
    	"storageBucket": "openhab-notification-mydomain.appspot.com",
	"messagingSenderId": "998212234566",
    	"appId": "1:998444034566:web:a15741c35f844444bece387"
    },
    "apn" : {
      "team": "PB1234567",
      "keyId": "BLABLA1",
      "host": "api.development.push.apple.com",
      "defaultTopic": "es.spaphone.openhab",
      "signingKey": "certs/aps/AuthKey.p8"
    },
    "ifttt" : {
      "iftttChannelKey" : "key",
      "iftttTestToken" : "token"
    },
    "legal": {
    	"terms" : "",
        "policy": ""
    },
    "registration_enabled": false
}

@Neolinger,

Thanks a lot, it is now working correctly.
Mainly missing the proxyHost directive in my configuration files.
And also a little configuration issue on my redirection because my instance of openhab-cloud is running inside a WSL container.

Have a good sunday,

Laurent.

1 Like

You too!
Mark the thread as solved please. :slight_smile: