I have created a cloud instance and connected it to my local OpenHAB system. While I can see that the instance is online, I do not see the dashboard, only a blank page.
Here is what I did in terms of network.
I acquired a domain through Amazon Route 53, and entered openhabcloud.MyDomain.com instead of the dummy names in config.json:
I would HIGHLY suggest you scrub your FQDN IP and e-mail from this post ASAP or you will quickly find it being picked up by public search engines.
Also would be helpful if you wrapped your log in code fences use the </> button
Since I could connect to the instance from myopenhab.org, and since I can see it is online, I don’t think the problem is on the side of my local instance. I am not sure why the ‘upstream connection’ should fail, and I am not sure what other logs to look at. If anyone has a running OpenHAB Cloud instance, could they share their configuration?
Thanks.
That is how it is working for me and based on the feedback also for others that replied in that thread. There is one or there are two more threads in which I appended this configuration resp. linked to that thread.
In the past the proxy host had to start with the word home. It is also served by apps.js.
Do you replace the default file in sites-enabled with the conf file (as per the instructions in GitHub), or the nginx.conf file? Does it matter?
Thanks!
Yes, you were right, the apps were not running. I should have checked this. I seem to have a problem with the service scripts. I am getting the following error (starting app.js manually with ‘sudo nohup node app.js’ works.
Thanks a lot. I am using v14.21.3, I had problems with more recent versions earlier. Strangely enough, I am not seeing such problems when I am calling app.js directly, not through a service. As a bypass, I started app.js, and another copy setting PORT=3001, and for both HOST=192.168.0.19 (my local OpenHAB). I verified that both are running and listening on their respective ports. I am still not seeing the dashboard. So I guess I still have some other problems, besides the scripts.
,
I am using a dedicated user ( openhabcloud ) to start the service. That user has the node_modules directory with the related modules. I would assume that that directory is being used - but is it used as well if you use root as service account ?
Th syslog has Sep 21 18:34:46 ip-10-0-1-24 openhabcloud[1413]: {"errno":-13,"code":"EACCES","syscall":"open","path":"logs/openhab-cloud-2024-09-21-process-3001.log"}
type or paste code here
For HOST, used the address of my local OpenHAB instance that I am trying to reach, is that correct? 192.168.0.19...
Both processes are up and running an listening on the appropriate ports, so I fear I must have somehow mangled the network setup.
Is there any ‘positive’ log entry in the access log files ?
The 502 in the access log file is the http return code for the related call and means that there was a problem.
Could it be that you have a mixture of using ip address 127.0.0.1 and ip-10-0-1-24 ?
It is possible to use 127.0.0.1 as long as the related service is hosted on the same host/computer. In case the service is running on a different computer the network address needs to be used instead of the localhost ip address.
I finally solved my problems. I was using 192.X.X.X as the address and should have used 127.0.0.1 instead. I used a conf file separating socketapp and webapp. It works with two instances of app.js listening on ports 3000 and 30001 (thanks again), but it also works with only one copy of app.js listening on port 3000. Here is the conf file I used for nginx for one copy.
# Used localhost as server, started 1 instance of app.js with port 3000 (works also with changing one port to 3001 and two instances of app.js listening)
#ssl_certificate /etc/letsencrypt/live/myopenhab.org/fullchain.pem;
#ssl_certificate_key /etc/letsencrypt/live/myopenhab.org/privkey.pem;
upstream webapp {
#server 192.168.0.19:3000;
server 127.0.0.1:3000;
}
upstream socketapp {
#server 192.168.0.19:3001;
server 127.0.0.1:3000;
}
#server {
# listen 80 default_server;
# listen [::]:80 default_server;
# server_name myopenhab.org www.myopenhab.org home.myopenhab.org;
# return 301 https://$server_name$request_uri;
#}
server {
listen 80;
server_name home.openhabcloud.xxx.com;
charset utf-8;
access_log /var/log/nginx/home.openhabcloud.xxx.com-access.log;
error_log /var/log/nginx/home.openhabcloud.xxx.com-error.log;
client_max_body_size 300m;
root /var/www/html;
location ~ /.well-known {
allow all;
}
location / {
proxy_pass http://socketapp;
proxy_redirect off;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Real-IP $remote_addr ;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for ;
proxy_set_header X-Forwarded-Proto https;
}
}
server {
listen 80;
server_name openhabcloud.xxx.org;
charset utf-8;
access_log /var/log/nginx/my.openhab.org-access.log;
error_log /var/log/nginx/my.openhab.org-error.log;
client_max_body_size 300m;
root /var/www/html;
location ~ /.well-known {
allow all;
}
location /css {
alias /home/ubuntu/openhab-cloud/public/css;
}
location /js {
alias /home/ubuntu/openhab-cloud/public/js;
}
location /img {
alias /home/ubuntu/openhab-cloud/public/img;
}
location /bootstrap {
alias /home/ubuntu/openhab-cloud/public/bootstrap;
}
location /font-icons {
alias /home/ubuntu/openhab-cloud/public/font-icons;
}
location /fonts {
alias /home/ubuntu/openhab-cloud/public/fonts;
}
location /js-plugin {
alias /home/ubuntu/openhab-cloud/public/js-plugin;
}
location /downloads {
alias /home/ubuntu/openhab-cloud/public/downloads;
}
location ~ ^/(socket.io|rest|images|static|rrdchart.png|chart|openhab.app|WebApp|CMD|cometVisu|proxy|greent|jquery|classicui|ui|basicui|doc|start|icon|habmin|remote|habpanel|ifttt/v1/actions/command){
proxy_pass http://socketapp;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Real-IP $remote_addr ;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for ;
proxy_set_header X-Forwarded-Proto https;
}
location / {
proxy_pass http://webapp;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr ;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for ;
proxy_set_header X-Forwarded-Proto https;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
#error_page 500 502 503 504 /50x.html;
#location = /50x.html {
#root html;
#}
}
I will now start looking at an ssl configuration.
Thanks again.