Re-enable HTTP together with HTTPS

On various Hardware and OS systems: pi / windows / routers / nas, etc
Post Reply
User avatar
BazsoDombiAndras
Posts: 102
Joined: Thursday 08 January 2015 10:52
Target OS: Raspberry Pi
Domoticz version: v4.97
Location: Cluj-Napoca, Romania
Contact:

Re-enable HTTP together with HTTPS

Post by BazsoDombiAndras » Sunday 04 November 2018 21:42

Hi!

I've installed a new Domoticz server and during the initial configuration I chose to have only HTTPS access (disabled HTTP). However, because HABridge is not working with HTTP (what a shame!), I wish to re-enable HTTP access and I can't find a way to do it. The outisde access to my Domoticz server goes through a reverse proxy on another server which redirects HTTP to HTTPS anyway, so outside access will always be over HTTPS. However, in LAN, using 192.168.0.x IP address, I wish to have it working also over HTTP.

In my domoticz.sh file I have this:

Code: Select all

DAEMON_ARGS="$DAEMON_ARGS -www 8080"
DAEMON_ARGS="$DAEMON_ARGS -sslwww 443"
This reads to me as "both HTTP over port 8080 and HTTPS over port 443 are enabled". However, that is not the case. I can access Domoticz at 192.168.0.x:443 over HTTPS but at 192.168.0.x:8080 I get nothing ("refused to connect"). Ok, so I changed the www port from 8080 to 80 to see what happens. I get an automatic redirect from http to https on the Domoticz server, which is very odd, because I've never configured such an automatic redirect on that machine and traffic is NOT going through the reverse proxy which forces this redirect for outisde connections.

Any idea what is going on here and how to enable both HTTP and HTTPS access?

Thanks!

User avatar
BazsoDombiAndras
Posts: 102
Joined: Thursday 08 January 2015 10:52
Target OS: Raspberry Pi
Domoticz version: v4.97
Location: Cluj-Napoca, Romania
Contact:

Re: Re-enable HTTP together with HTTPS

Post by BazsoDombiAndras » Sunday 04 November 2018 21:48

Well, in Firefox I get nothing at http://192.168.0.x, only Chrome does that auto-redirect to https (very odd). Must be some Chrome wizardry.
Anyway, so the bottom line is that even though in the domoticz.sh both HTTP and HTTPS are enabled, it only works over HTTPS on port 443, HTTP does not work on port 80 or 8080.

User avatar
BazsoDombiAndras
Posts: 102
Joined: Thursday 08 January 2015 10:52
Target OS: Raspberry Pi
Domoticz version: v4.97
Location: Cluj-Napoca, Romania
Contact:

Re: Re-enable HTTP together with HTTPS

Post by BazsoDombiAndras » Sunday 04 November 2018 22:38

The solution is to change the ports in /etc/init.d/domoticz.sh, NOT in /home/pi/domoticz/domoticz.sh (or wherever it is installed).

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests