Hi All
I configured reverse proxy for openhab2
http works ok but https returned follwing error
400 Bad Request
The plain HTTP request was sent to HTTPS port
my configuration in /etc/nginx/site-enable/default looks like this
yes
I opened both
I redirect port on my router. Port 8081 is redirected to port 443 on my host behind router
i looks like this
port 8081 -> port 443 on 192.168.1.157
If i enter https://mydomain:8081 from outside its redirect me to local host and ask me to enter user name and password till now it works OK
but after I enter user and password browser change https to http and url looks like this http://mydomain:8081/start/index if i mnualy change http to https it works OK
nginx is a proxy, it serves as a secure window into you openHAB instance. Your local server would be running as normal and is fairly unaware of nginx. You connect securely to nginx, which the passes the information on to openHAB locally.
This means that you should simply open port 443 on your router and foward it to the ip of your openHAB machine. Using the default options in the tutorial @ThomDietrich posted above, you simply would have to write: ((notice no port)).
https://mydomain/start/index
You’re now connecting to nginx via port 443, and nginx is passing the information for you via localhost:8080
If you want to use any port other than 443, you’re free to do so but you need to specify it in the URL. You should not need to create an additional redirect to port 443 because your local network likely does not care which port it is.