IOS App - Remote URL discards path after the hostname:port

I’m trying to configure remote access to my OpenHab setup through an existing domain. Instead of creating a new subdomain, eg. https://openhab.mydomain.com, I was planning to use a reverse-proxy that proxies https://mydomain.com/openhab to my actual openhab server. Unfortunately, the IOS app doesn’t appear prefix the /rest/ requests with the path portion of the Remote URL (they should be /openhab/rest/).

There are a few good reasons to support this approach:

  • for people who only have a single routable IP address, it allows OpenHab to work more seamlessly with other servers/services that may be running.
  • it is more secure - if there isn’t a public link to the openhab URL, one would have to guess or randomly try URL paths to stumble upon the openhab server (the path can be a random string that is much more difficult to guess than running a port scanner for additional open ports).
  • it can be easier to host as you don’t need to set up a separate subdomain for the openhab server.

Has anyone else tried this?

First of all: I did not.

From my point of view this is logical as your idea is different from the original architecture of the design.
Keep in mind in your request the server’s root directory is moved to /openhab while it is / in the original design. Your request only would work if the app would ask the server where the root directory exists.

Using different subdomains/defining different virtual servers on the reverse proxy is still possible with a single IP address.

Isn’t this just security through obscurity ? Agreed it is harder to guess the right random string depending on it’s length - even random strings can be guessed - just more trials need to be done. As long as it is part of a dictionary it is just a matter of a good dictionary.

but you still need to redirect/rewrite stuff that is intended for /openhab ?