Remote access HA using Nginx on unraid

I have a VM on unraid running an OS version of HA. To access HA I currently use http://homeassistant.local:8123.

I also run Nginx on the same unraid server in a docker to remotely access the other apps on my server. I would like to use Nginx to remotely access HA as well.

I have been searching through guides and YouTube tutorials for weeks but cannot get remote access to work for HA. All the guides I found explained how to use duckdns/cloudflare to directly connect to HA, however, as I already forward my port 443 traffic Nginx these methods do not appear to be working. Any help would be greatly appreciated!

Please let me know if you need any additional information.

You need to forward both http(s) and websockets.

@Jett14
have just sorted this out, I’m running Nginx Proxy Manager on Unraid.

UnRaid Docker App - NginxProxyManager

Add new Proxy Host

Domain Name : custom domain
Scheme : http not https
Forward Hostname / IP : your HomeAssistant OS (mine is a NUC) or Raspberry Pi IP address
Forward Port : 8123

Websockets Support : Enable

Go To SSL Tab,

SSL Certificate enable lets encrpyt like your other Apps on Unraid.
Enable : Force SSL, HTTP/2 Support, HSTS Enabled & HSTS Subdomains.

Click Save

Router Settings

Make sure your Router has Port 443 forwarding turned on to Forward IP (HA OS) and Forward Port : 8123, only need protocol TCP

Private Domain Settings

If not already create a new CNAME for your subdomin for HAOS and point to your Duckdns.org record.

Home Assistant Setup

You will need to update your Configuration.Yaml to accept a trusted proxy, this is where I was missing a final step, please map this to your Unraid Server IP address, the port for Nginx isnt required, just the IP Address.

http:
use_x_forwarded_for: true
trusted_proxies:
- 192.168.1.??

Settings, Network

You don’t need to add a new Home Assistant URL here, mine is blank.

Let me know if this helps, everything seems to be working now and correctly issuing a HTTPS cert, local access is unaffected now through :8123

Hi MrTim

I tried this with my HAOS (running as VM on Unraid).
I simply get this error: 400: Bad Request

I don’t get what port i should forward… I have 80 and 443 forwarded to my unraid server IP and i can access my Jellyfin Server with my nginx configuration.

How can i find the error?

Best regards hudu

1 Like

Update - Anyone having the Bad Request error please see the attached thread. https://community.home-assistant.io/t/home-assistant-400-bad-request-docker-proxy-solution/322163