Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

HomeAssistant / Hass.io with SWAG

Featured Replies

I am using the hassio_supervisor docker container which in turn installs several other containers in Docker including the homeassistant container.  I am also running the SWAG container which uses nginx for it's reverse proxy.  The problem I'm having is nginx requires a custom bridge network for it to route traffic to the proper container, in this case, the homeassistant container.  While I can set the network by editing the hassio_supervisor container, I am unable to edit the homeassistant container and it's using the host network.  Does anyone know of any workarounds for this?  I'm farily new to unRAID so I'm not sure if it's possible to edit containers from the terminal or if there are other ways to configure nginx files to map to containers on the host network.  Any help would be greatly appreciated.  I did come across this but I haven't given it a try yet: 

 

  • 1 month later...

Did you ever figure this out? I am running home assistant core in host network and swag on it's own network (that works as reverse proxy for those). If I change HA to network it stops working and if I point swag to HA in host mode, it doesn't see it.

 

Edit: Working - leave HA in host and in SWAG config, just point to IP

Edited by squish102

where do you point to home assistant in the SWAG config?

  • 2 weeks later...
On 1/16/2021 at 5:09 AM, BelgarionNL said:

where do you point to home assistant in the SWAG config?

 

Open the config and you will see two lines like below: 

 

"proxy_pass $upstream_proto://$upstream_app:$upstream_port;

 

Delete $upstream_app and repalce with IP of HA instance. You'll need to do it for both.

 

 proxy_pass $upstream_proto://10.1.1.200:$upstream_port; (For example)

 

Save config and restart SWAG.

  • 1 month later...

I keep having an issue where after I try to login via the cname I created I get a message that says "Unable to connect to Home Assistant." If I log in via the local IP it works fine. Im using the HA core docker and its network is set to host.

 

I was able to get it working adding these lines to my nginx config file

 

proxy_pass http://ip-address:8123;

proxy_set_header Host $host;

proxy_set_header Upgrade $http_upgrade;

proxy_set_header Connection "upgrade";

 

Anyone see any issues with adding these line?

Edited by TrueImpulse

  • 3 months later...

Is it safe to have nginx point to something on the host network?

 

In addition to this proxy-conf modification, what do you need to define in the configuration.yaml of the appdata of the HA container?

  • 3 months later...

@bigbangus

You would need to add the following lines to the configuration.yaml file:

 

http:
  use_x_forwarded_for: true
  trusted_proxies:
    - 172.XX.XX.XX # The SWAG docker IP address

 

You can always check for your SWAG docker IP address by checking it in the port mappings column of the Dockers tab.

  • 1 month later...

Worth sharing one more thing to simplify complications later on.  You can set the trusted_proxies value in the HomeAssistant configuration to the Docker IP Range!

This way if you ever have to change (or re-install SWAG; like I just had to do) you won't have a broken HomeAssistant instance (with no recollection of having worked all this very specific IP stuff out some time back)....
 

http:
  use_x_forwarded_for: true
  trusted_proxies:
    - 172.X.0.0/12 # The IP Range for SWAG docker IP address

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.