Yet another reverse SSH tunnel question - 404: Not Found

Hi,

The issue is when I attempt to access my https://domain.duckdns.org/hass I get 404: Not Found
If I run it on my local network http://192.168.1.2:8123 it works just fine.

What have I attempted to do:

  1. Manually installed Home Assistant onto a Raspi using virtualenv(behind ISP NAT).
  2. SSH reverse proxy from Home assistant device to Cloud machine(has public IP and assigned to duckdns.org domain name)
  3. On cloud machine there is Caddy which reverse proxies the https request and forward the request to the Raspi with Haas.

More details
On Raspi haas device I’ve manually installed autossh and created a service. However for testing i’m using an ssh cmd like this(I can see the connection made on the Cloud machine):

ssh -i /home/pi/.ssh/ssh-key-2020-10-21.key -R 8888:localhost:8123 ubuntu@mypublicip

My Caddyfile:

domain.duckdns.org/haas {
    reverse_proxy * localhost:8888
}

What am I missing? :frowning:

Thanks

Is this a copy paste error in your Caddy file?

domain.duckdns.org/haas

Shouldn’t it be:

domain.duckdns.org/hass

?
Not sure.
Hass.domain.duckdns.org no? DuckDNS doesn’t do folders does it? Shouldn’t it be a sub domain? That is how my caddy works.

Woah that really helped David! Thanks!

Part of the solution was removing the ‘/haas’ at the end so now my domain looks just like https://turboluck-caddy.duckdns.org/

The other big issue was that the Oracle cloud instance I’m running seems to reset it’s iptables(I’m not aware of the when/why). Suddenly the machine will be inaccessible via port 80 + 443. Using iptables-persistent sorted that out.

2 Likes

In case you want to do this with an HA addon, I’ve written a guide and published an add-on, just for this.