[SOLVED] Android app: Local access not work after app update

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

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.

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.

most likely a fubar nginx configuration…
by the way: why you go via nginx locally?

i don’t like to leave access to my openhab without encrypted password even in locally in case of someone hack my wifi.

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

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

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

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.

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

First step already not work. :sob:

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 ?

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

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.

well, if you use http in the URL, it won’t use SSL (only with https)

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

yeah, that the page

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?

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

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