I need to publish OpenHab to public, so I configured a reverse proxy to add authentication to OpenHab 2.
If I configure in HabDroid the url of the reverse proxy, it does not connect and stay in connecting indefinitely.
Same URL, opened from a Browser, it show me Basic Autentication and then Openhab 2 pages without any issue.
Someone can help me?
I haven’t experimented with HabDroid yet, but I may be able to install it in the next couple of days to help you out. But let’s go through the debugging routine now.
What is your reverse proxy configuration? When you say url of the reverse proxy, is this for images?
I have a synology NAS. This permit me to reverse proxy some internal host. External url is ohab2.something.myds.me, internal url is 192.168.XXX.80:8080
But synology do not permit me to add authentication on reverse proxy configuration. So I created a virtual host with an .htaccess file that authenticate and then redirect.
So configuration is:
External_>Reverse Proxy->VirtualHost with .htaccess redired->Openhab
I do reverse proxy and virtual host with apache and this is configuration of .htaccess:
RewriteRule (.*) http://192.168.XXX.80:8080/$1 [P,L]
I Hope I’m clear, if you need more info please ask me.
I also tried with AuthType "Normal"
but still no work.
Tomorrow I’ll do a test with a Reverse Proxy but without authentication and redirect.
Since you’re using Apache, have you tried the method outlined here?
Depending on how much you want to fiddle around, I can really recommend looking into openvpn, many routers (asus for instance) have support for it.
I’m using it to reach openhab from the outside on both android and iOS.
I have OpenVPN server on my router, for me is fine, but not for my wife. She is not able to connect in VPN then use OpenHab.
For this reason I use a reverse proxy.
I know the apache configuration you mentioned, but my reverse proxy is a Synology NAS that running apache. I have a graphical interface to configure reverse proxy, and I cannot add authentication, and I cannot handle configuration files, because at every reboot my customization gone lost.
Tomorrow I did more testing with another reverse proxy on debian, and I try to configure it.
Beside this, when openhab2 will have integrated authentication like 1.X branch?
just for information, I solved using 2 reverse proxy. The one on Synology is used as external frontend and SSL offloading, the internal one (Apache) is used for authentication.
Thanks all for help.