Redirect app to Home Assistant on raspberry on same local network

Hey
I’m getting desperate. I have home assistant running on rpi. I installed Yunohost on a mini pc running proxmox.
I tried to use nginx proxy manager to use both from my domain name. Problem is it’s too difficult for me…the dns get mixed up and i guess the problem is my yunohost server doesnt know it is used throw nginx proxy manager…
So now i’m trying to use this app i just discovered : Redirect as proxy.
Problem is i dont manage to set it up !
When i use https://homeassistant.localIP:8123, it fails : 400:bad request.
if i add : https://homeassistant.localIP:8123/dashboard-mydashboardsname/
I get only the home assistant logo in middle of page lol…
In my config yaml, i wrote :
http:
ssl_certificate: /ssl/fullchain.pem
ssl_key: /ssl/privkey.pem
ip_ban_enabled: true
login_attempts_threshold: 5
use_x_forwarded_for: true
trusted_proxies:
- 192.168.myYUNOHOSTip

Thanks for your help !
Any idea welcomed, i just want to be able to reach my home assistant and yunohost on my domain name while they both are on same local network using same internet provider !

According to your other post, you seems to have some problems on the cohabitation of your 2 servers.

So, tell me if I’m wrong :
You have 2 domain names :

On your box, which machine is configured as the destination ? (your box does not understand domain names, only ports (well, it could, but usually, it does not)).

The thing you should do is (I think) :
Internet Box : tell it that your YunoHost server is the destination for ports 80 and 443 (and many others, depending on what you want to do.
Have a look here : Configure port-forwarding | Yunohost Documentation
And here : DNS zone configuration | Yunohost Documentation

Home Assistant : I have no idea about it, but to simplify things, it should only act in HTTP and not HTTPS, the S will be done by YunoHost.
There may be some problem with it’s url but that is not 100% certain, it depends of how this software is developed AND configured.
Note : do you need access to it from the Internet ?
What is this 8123 port, something you configured or is it by default ?

YunoHost : both domains should be configured on YunoHost, both with let’s encrypt certificates.
And to access Home Assistant, use (on YunoHost) the app Redirect, and use it as a reverse proxy

I know this is not really simple, it is in my head, but that is not really easy to explain.

1 Like

In my case, it’s YunoHost the one managing the SSL, not the HomeAssistant, and I believe that’s why my config.yaml is different.

Install the Let’sEncrypt certificate for the HomeAssistant [sub]domain on YunoHost.

If you suffer from hairpinning, you’ll have to edit your hosts file or router settings or include this on your DNS server (such as PiHole):

  • maindomain.ltd → 172.16.1.1
  • homeassistantdomain.ltd → 172.16.1.1

They both point to your YunoHost server because that’s the server managing the connection to your HomeAssistant server — it goes through your Proxmox/YunoHost).

Install redirect. reverse-proxy is what you want. Define the address of the Raspberry running HomeAssistant. Eg: http://172.16.2.1:8123

RaspberryPi
Edit configuration.yaml:

http:
  server_port: 8123
  use_x_forwarded_for: true
  trusted_proxies:
    - 172.16.1.1 # this is the address of your YunoHost server
  ip_ban_enabled: true
  login_attempts_threshold: 5 # or whatever you want

I’m sure there is a way to do this using the interface but I don’t know where it is. I’ll edit this if I find it.

And that’s it. I can connect to my HomeAssistant via HTTPS from my phone.

1 Like

Thanks for you help mamie ! You understand internet much more than my grandmas used to !
I’ve been discovering so many things in last days : proxmox, self hosting, proxy, reverse proxy, ipv4, ipv6, DHCP, firewall… My brain is exploding and confused and my posts were confusing !
I was about to leave it for a while but your answer and the other helped me a lot, and i was not that far from managing it !
Thanks !

Thanks xabi ! you’re my hero ! :wink:
I just started all over and it works !
Only one problem left lol !
I had to remove the ip ban cause it fails to log so many times. When i check log, it’s linked to the api/calendar…

Enregistreur: homeassistant.components.http.ban
Source: components/http/ban.py:128
intégration: HTTP (documentation, problèmes)
S’est produit pour la première fois: 22:40:00 (44 occurrences)
Dernier enregistrement: 22:43:51

Login attempt or request with invalid authentication from my IPadress. Requested URL: ‘/api/calendars/calendar.numeros_de_semaine?start=2024-03-31T22:00:00.000Z&end=2024-05-12T22:00:00.000Z’. (Mozilla/5.0 (X11; CrOS x86_64 14541.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36)

I’m going to look for that but if you have another great idea…
Thanks again cause i’ve got the feeling i’m almost there !!

Hey
I can’t find any solution about this Google calendar integration login error…
Login attempt or request with invalid authentication from myip.
Any idea please ?

I’m afraid I don’t have any experience with that.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.