bassysta
(bassysta)
November 17, 2018, 10:12am
1
Hi.
After the app update to 2.4, i’m unable to access my sitemap locally.
I configured nginx proxy to custom httpsport with pwd authentication and all work fine until the last update.
anyone with same problem?
P.S. if i disable nginx and set standard port all work fine
Thanks
mueller-ma
(Mueller Ma)
November 18, 2018, 9:26am
2
Hey @bassysta ,
can you go the settings and enable “Show info for troubleshooting”? After that go back and make a screenshot of the error message.
bassysta
(bassysta)
November 18, 2018, 11:02am
3
Hi
the problem is that is stuck on charging icon, it not said that is unable to connect (and on left panel i can see my sitemaps list), it try to charge the sitemap continuously.
Dim
(Angelos)
November 18, 2018, 11:37am
4
most likely a fubar nginx configuration…
by the way: why you go via nginx locally?
bassysta
(bassysta)
November 18, 2018, 1:00pm
5
i don’t like to leave access to my openhab without encrypted password even in locally in case of someone hack my wifi.
Dim
(Angelos)
November 18, 2018, 1:01pm
6
and did you stop OH2 from listening to the LAN? (or just changed the default ports)
anyway, you have a broken nginx configuration. fix it
bassysta
(bassysta)
November 18, 2018, 1:03pm
7
i’ve block def. port with firewall, do you think is nginx? because if i try to connect from my pc i’ve no problem to access from custom https port
Dim
(Angelos)
November 18, 2018, 1:06pm
8
it could be an issue with the mobile app… but if you can’t produce any logs… it’s going to be hard to debug this
another option is for you to post the configs so other people can replicate this and debug it
bassysta
(bassysta)
November 18, 2018, 1:09pm
9
And here we go:
server {
listen 10445 default_server ssl;
ssl_certificate /etc/ssl/openhab.crt;
ssl_certificate_key /etc/ssl/openhab.key;
server_name openhab;
error_log /etc/nginx/logs/error1.log;
#access_log c:/nginx/logs/access1.log;
location / {
proxy_pass http://localhost:8080 ;
auth_basic “Username and Password Required”;
auth_basic_user_file /etc/nginx/.htpasswd;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /var/www/nginx-default;
}
I remark that all happened after app update
Thanks anyway for your replies.
Dim
(Angelos)
November 18, 2018, 1:20pm
10
Try the following (disable ssl & auth as a first step):
server {
listen 10445;
server_name openhab;
error_log /etc/nginx/logs/error1.log;
location / {
proxy_pass http://127.0.0.1:8080;
proxy_buffering off;
proxy_set_header Host $http_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 $scheme;
}
}
if this works, bring back auth:
server {
listen 10445;
server_name openhab;
error_log /etc/nginx/logs/error1.log;
location / {
proxy_pass http://127.0.0.1:8080;
proxy_buffering off;
proxy_set_header Host $http_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 $scheme;
# Auth settings
auth_basic "Username and Password Required";
auth_basic_user_file /etc/nginx/.htpasswd;
}
}
if this works, bring back ssl
bassysta
(bassysta)
November 18, 2018, 1:42pm
11
First step already not work.
Dim
(Angelos)
November 18, 2018, 1:43pm
12
not even from a LAN PC?
any errors in /etc/nginx/logs/error1.log
?
did you change the mobile app Local server URL settings to not use ssl and auth when they connect to http://nginx_ip:10445
?
bassysta
(bassysta)
November 18, 2018, 2:01pm
13
And here i drop the bomb:
After the app update tht option about “not use ssl” totally disappear, i thought that now the app is able to detect when use it or not
Dim
(Angelos)
November 18, 2018, 2:10pm
14
just fyi: this is the thread that the mobile app will send you to when you press the ? button next to the SSL Certs configuration.
Note: this tutorial is how to configure Client side Certs (not Server side which are configured in nginx). I just post it to see an example of a working configuration of reverse proxy. Disregard both client and server certs for now until you get the basic reverse proxy functionality working.
Dim
(Angelos)
November 18, 2018, 2:11pm
15
well, if you use http
in the URL, it won’t use SSL (only with https
)
bassysta
(bassysta)
November 18, 2018, 2:21pm
17
you right, my bad.
Still no luck , tried http://ipaddress:10445 , the app reply:
http://ipaddress:10445/rest Exception Stack java.io.IOexception: bad request
Dim
(Angelos)
November 18, 2018, 2:27pm
19
try:
proxy_pass http://127.0.0.1:8080/;
(with a slash at the end)…
can you access this URL (http://ipaddress:10445
) from a LAN PC?
bassysta
(bassysta)
November 18, 2018, 2:41pm
20
here the config, now i can’t access from lan PC neither
server {
listen 10445;
server_name openhab;
error_log /etc/nginx/logs/error1.log;
location / {
proxy_pass http://127.0.0.1:8080/;
proxy_buffering off;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_$
proxy_set_header X-Forwarded-Proto $scheme;
}
}
UPDATE:
I’m unable to acces it in http, but still i can in https even without cert. configuration
bassysta
(bassysta)
November 18, 2018, 6:07pm
21
i’ve figured out.
cleaning up nginx folder before reinstall, i found an old config file inside sites-enabled that make conflict.
Sorry to waste your time, have a nice day.
1 Like