I followed the tutorial here: http://docs.openhab.org/installation/security.html Everything worked as described: Nginx was doing the reverse proxy thing. But when I tried to replace “location / {” with “location /openhab {” and then access OH2 as https://my domain/openhab, all I am getting is that “openhab is not found”. I tried adding slashes at the end of openhab to no avail. I think the “not found” message is coming from Jetty, not Nginx.
Does anyone know how to rewrite the Nginx reverse proxy example from the above tutorial for the case of a non-root location? This is principal for me, as I’m also running my regular web site on the same PC, so I want the “OH2 behind Nginx reverse proxy” to co-exist with my regular web site.
It can’t be done as far as I can tell. The problem is nginx will translate the incoming URL but it doesn’t replace the URLs embedded in the HTML, or even worse, generated by JavaScript. So you request something from HTTPS://blah.com/openhab and all the URLs in the HTML are HTTPS://blah/
If you need it to coexist with some other web app you will need to proxy openhab on a port other than 443.
Might be too late on that… but for the record … we got this working in subdirectory with the same code as of @kohlsalem, only added the host header, as of:
Upon loading the PaperUI, I get a lot of these 404 errors: No items/things are shown on the UI. This does not happen when accessing the address from its local name. Any idea how to fix this?