Home Assistant Remote Access using NGINX

  Рет қаралды 37,457

Smart Home Addict

Smart Home Addict

Күн бұрын

Thank you for watching. In this video we will take you through setting up remote access using NGINX. We are using DuckDNS for this but you can use any dynamic DNS service.
DuckDNS - duckdns.org
Code to be added to configuration.yaml (NGINX):
http:
use_x_forwarded_for: true
trusted_proxies:
- 172.30.33.0/24
To fix issues with addons using their own web server, such as ESPHome, create a file called nginx_proxy_default_fix_ingress.conf and paste the following in:
location /api {
proxy_connect_timeout 60;
proxy_read_timeout 60;
proxy_send_timeout 60;
proxy_intercept_errors off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $host:8126;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass homeassistant.local.hass.io:81...
}
Code to be added to configuration.yaml (ip ban, optional):
ip_ban_enabled: true # use this to enable auto IP ban
login_attempts_threshold: 3
Please like and subscribe, and click on the notification bell so you can be alerted to new videos. Please also consider being a patron at Patreon (link below).
If you would like us to create videos on a particular topic, technology or product, please leave a comment below.
When browsing to your Home Assistant instance, this is usually - homeassistant.local:8123. If this does not work, try homeassistant:8123. If all else fails, check your router's device listing for the IP address. Once you have an SSL certificate set up, remember to use https: in front of the URL.
Chapter links:
0:00 - Intro
0:45 - DuckDNS - Create Domain
1:32 - Install & Configure DuckDNS addon
2:74 - Router Port Forwarding
3:12 - Install & Configure NGINX Proxy addon
4:26 - Home Assistant Configuration
5:23 - Extra steps for addon compatibility
6:52 - Testing
7:43 - IP Ban (optional)
The below is optional but this will help us to purchase kit for review, and to keep up with channel expenses (studio equipment, etc). We may earn a commission if you purchase something through these links.
Amazon link (as an Amazon associate we earn from qualifying purchases) - [amzn.to/3fj2S8a](amzn.to/3fj2S8a)
Ko-Fi - [ko-fi.com/smarthomeaddict](ko-fi.com/smarthomeaddict)
Buymeacoffee - [www.buymeacoffee.com/smarthom...](www.buymeacoffee.com/smarthom...)
Patreon - [ / smarthomeaddict ]( / smarthomeaddict )
Finally, please visit our website at [smarthomeaddict.co.uk](smarthomeaddict.co.uk/)
BTC: bc1qdhnyctwr455vwskhjwl04dm9hucjq55yxyy9cu
BCH: qr4jur8nuf7cjmctwjheyfsq39l93lesgvgz7snj3k
ETH: 0xBB6601Be92F27D688F3a47e952866Cb68d1E2170
DOGE: D5ZBGuoJQmqMkdJjjosw4JsYgp95b1CL56

Пікірлер: 61
@SmartHomeAddict
@SmartHomeAddict Жыл бұрын
A written guide along with code samples can be found here - smarthomeaddict.co.uk/2022/10/home-assistant-remote-access-using-nginx/
@AlexAmore
@AlexAmore 6 ай бұрын
hi! ESPHome doesn't work out of the network but just within the LAN. I've filled the file in share folder but nothing... Any help?
@BonJoviFan13
@BonJoviFan13 Жыл бұрын
Best video ever. For a few months I couldn't get it to work but you provided in depth details on what to do. You are amazing my friend! You just saved the rest of my hair from being pulled out.
@jmpcrx
@jmpcrx Жыл бұрын
Great, thanks 👍 got working with my duel router setup, took a while though. Straight to the point, no babbling, everyone else should take note 👍👍
Жыл бұрын
Thanks, this was super helpful! Once I understood that the internal port to forward to is 443, everything started working great using this add-on.
@netoxplod87
@netoxplod87 Жыл бұрын
Very good video. Cleary and Short!
@tonyknors672
@tonyknors672 Жыл бұрын
Great video with very clear instructions. Well done and thank you !!!!
@dreyolion6755
@dreyolion6755 3 ай бұрын
You are the best!!! Watched other videos but that didn't work for me! Thank you so much!!!!!
@adree06
@adree06 11 ай бұрын
Super helpfull! All clear and liked the pace of explanations. Cheeers!
@vishvashanda9369
@vishvashanda9369 10 ай бұрын
Your tutorials are great! Thank you so much!! 🙏🏽
@SmartHomeAddict
@SmartHomeAddict 10 ай бұрын
Thank you, I'm glad you liked them!
@vishvashanda9369
@vishvashanda9369 10 ай бұрын
@@SmartHomeAddict wow, my replies are being deleted for some reason! 🙀
@nigelholland24
@nigelholland24 Жыл бұрын
Great video very clear. Thank youm
@chrise666
@chrise666 11 ай бұрын
Works perfectly.
@luizcarlosrosa2395
@luizcarlosrosa2395 9 ай бұрын
Greate video! Thanks! Good Look!
@simonlesorcier
@simonlesorcier Жыл бұрын
Very nice video, Thx
@woollysoxx
@woollysoxx 8 ай бұрын
Great help, Thanks
@jigler
@jigler 7 ай бұрын
Many thanks!!
@KrispKiwi
@KrispKiwi Жыл бұрын
This works however I ran into a problem, Alexa Media Players hacs integration doesn't seem to work when trying to pull a sound file through with nginx enabled. It works fine with the standrad Duckdns install. Any ideas?
@marcinzdrojewski4721
@marcinzdrojewski4721 9 ай бұрын
Thank you
@MartinStoyanov96
@MartinStoyanov96 Жыл бұрын
After i created the nginx_proxy_default_fix_ingress.conf file i still cant open for example Studio Code Server and in ESPhome cant open wireless logs. Any ideas why ? ( FIXED - It seems that i no longer need the .conf file i removed it and restarted nginx addon )
@ChunkySteveo
@ChunkySteveo Жыл бұрын
Thanks for this! When he said the .conf, he means the nginx_proxy_default_fix_ingress.conf file from the step in the video. Thanks again!
@unlock-er
@unlock-er Жыл бұрын
Hiya, just wondering if your website is still up? I'm using an existing nginx box and using this method I found that there's a bit of a lag. I can access esphome fine just a tad slow. just wondering what I might need to look into. any guidance be much appreciated.
@not-8909
@not-8909 Ай бұрын
thanks
@M9quattro
@M9quattro Жыл бұрын
Hi, until now I used my HomeAssistant by creating my domain duckdns and opening port 8123. In this way I was able to connect remotely without problems, Since this configuration completely blocked me from accessing the local ip, I tried to follow this clear video guide also using nginx but it only connects locally and not with my domain duckdns. It must be said that I had to change the port from 443 to another (I also made several tests with 4433 for example) but in this way it always gives me error 400: Bad Request. I had to change the port because on the 443 I already have apache2 for nextcloud running on another raspberry.
@SmartHomeAddict
@SmartHomeAddict Жыл бұрын
I do make reference to using other ports in the video. The problem with specifying an exact number for a port is that you could be using something already on that port, so had I said (for instance) use 9443, there's a chance somebody may have already had this on either their Home Assistant instance or another service. I will however try to make this clearer in future videos.
@M9quattro
@M9quattro Жыл бұрын
@@SmartHomeAddict I figured you didn't specify it due to problems. Thank you At this point, even having tried more ports, it could be a problem related to the modem (FritzBox).
@gabrieldragan4118
@gabrieldragan4118 Жыл бұрын
I'm missing the share folder. Any comments regarding that?
@mr.invisible5528
@mr.invisible5528 Жыл бұрын
Hi. I used this approach but my aws alexa integration stopped working as the endpoint /api/alexa/smart_home is now controlled by nginx and I always get the error ERR_SSL_UNRECOGNIZED_NAME_ALERT . Any help with this please?
@fiveaboy
@fiveaboy 5 ай бұрын
Do I still need to use duckdns if I have a fixed static IP ?
@d0kraz481
@d0kraz481 6 ай бұрын
help i installed virtualbox image version on windows. could not get it work eventhough i tried all your steps
@mtbadventures8277
@mtbadventures8277 Жыл бұрын
hello i did all the steps, i opened the port 443 on my router but it seems that it dosent work
@danbatista3158
@danbatista3158 5 ай бұрын
Hi, i have followed the video managed to connect with duckdns domain but it still showing connection not secure.. any help ? thank you
@LEWISTAI
@LEWISTAI Жыл бұрын
Hi buddy, After doing this, my Mqtt not working. Can you please to advise what steps I may have done wrong. Thanks a lot. 🙏
@pauldaniels6726
@pauldaniels6726 12 күн бұрын
At the test part my duckdns domain takes me to my Linksys router login page.
@kasek4164
@kasek4164 Жыл бұрын
will i be able to incorporate google and alexa speakers with this?
@ParodieHecker-mobile
@ParodieHecker-mobile 3 ай бұрын
I am using Alexa Media Player and a Custom Alexa skill to bring my HA devices to Alexa - so yes :)
@olivername
@olivername 7 ай бұрын
how would I make ssl work because smarthings not working thanks
@sashb9331
@sashb9331 Жыл бұрын
Recently this stopped working for me and could not figure out why. Turns out my ISP had forgotten to send me an opt out on the CGNAT IP addresses. Called them up and asked them to assign me a static IP. This fixed the issue. I can now connect from my Phone. Hope this helps others
@jonathancochran508
@jonathancochran508 6 ай бұрын
I think this must be my issue: everything is working locally, however when I try to connect remotely using the HA Android app, I get an error: "ERR_CONNECTION_REFUSED" I'll call up the ISP to get a dedicated IP and hope that solves it
@Tarikmoe
@Tarikmoe Жыл бұрын
Oh shoot. I’ve been using duckdns by itself for the past 6 months or so. Am I playing with fire ? 😅
@SmartHomeAddict
@SmartHomeAddict Жыл бұрын
You could be, it depends on other factors too. You're allowing traffic over an unencrypted port, so anybody could in theory see what you're sending and receiving, for instance if you're on a wifi network you don't control. It's useful to have something handling SSL traffic, and this method is probably one of the safest.
@antmck33
@antmck33 Жыл бұрын
So, does this mean I could get rid of nabu casa? 🤔
@SmartHomeAddict
@SmartHomeAddict Жыл бұрын
Yes you can, at least for remote access. I'll be doing another video soon about what to do about Alexa and Google Assistant.
@asocialconsciousness8535
@asocialconsciousness8535 Жыл бұрын
i cannot find home assistant url settings in system>network
@ukaszwaszczeniuk4936
@ukaszwaszczeniuk4936 Жыл бұрын
did you found a solution?
@medvenox
@medvenox 8 ай бұрын
you need to enable advanced mode in your user settings
@gfavarato822
@gfavarato822 Жыл бұрын
Additional security, enable multi-factor authentication for all users that access with external url.
@droopie
@droopie Жыл бұрын
didnt blur your ip from the duckdns log fyi
@marcosgrignuoli8423
@marcosgrignuoli8423 Жыл бұрын
the conf file in the description is truncated on line :13
@ELGee1
@ELGee1 Жыл бұрын
say what? is that bad?
@stefesciberras
@stefesciberras Жыл бұрын
@@ELGee1 Yes... The video shows that it ends in 8123/api, not with dots
@jamesbuckle6077
@jamesbuckle6077 Жыл бұрын
Hmm I broke my HA. I was using DuckDNS with LetsEncrpt and exposing port 8123 by forwarding 443>8123. Then I followed this vid and changed the port forward 443-8123, just exposing native 443, and now I cannot access it via the external address, only internal, due to a 502 bad gateway error (browser) and just an access error on the app.
@kmtsvetanov
@kmtsvetanov 8 ай бұрын
did you fixed it ?
@jamesbuckle6077
@jamesbuckle6077 8 ай бұрын
@@kmtsvetanovI did, but not through any helpful way. I gave up trying. I waited a month or so, and then I re-installed the add-on and re-configured using the same values and now it works. Nothing was evident from the logs.
@What_s_Neu
@What_s_Neu Жыл бұрын
i have a error in the nginx logs. nginx: [emerg] invalid URL prefix in /share/nginx_proxy_default_fix_ingress.conf:13. Any idea how to fix that?
@What_s_Neu
@What_s_Neu Жыл бұрын
i figured it out. i copied the code from your website and didn't take out the < and > on line 13 lol. Great video!
@walberg61
@walberg61 Жыл бұрын
[15:30:29] INFO: Running nginx... nginx: [emerg] unexpected "}" in /share/nginx_proxy_default_fix_ingress.conf:14 [15:30:29] INFO: Service nginx exited with code 1 (by signal 0)
@stefesciberras
@stefesciberras Жыл бұрын
Yes... The video shows that the code ends in 8123/api, not with dots
Install InfluxDB On Synology NAS in Docker | InfluxDB
14:13
Accediendo a Home Assistant desde fuera de casa
25:13
Pedro González Gil
Рет қаралды 40 М.
Inside Out Babies (Inside Out Animation)
00:21
FASH
Рет қаралды 22 МЛН
Stay on your way 🛤️✨
00:34
A4
Рет қаралды 24 МЛН
Red❤️+Green💚=
00:38
ISSEI / いっせい
Рет қаралды 88 МЛН
What's going on with Windows Laptops?
10:30
Marques Brownlee
Рет қаралды 1,9 МЛН
Home Assistant Remote Access using Cloudflare Tunnels
9:30
Smart Home Addict
Рет қаралды 16 М.
Reset your Home Assistant Password 2024
2:28
Luxeia Smart Homes
Рет қаралды 3,6 М.
Home Assistant Remote Access for FREE - DuckDNS + LetsEncrypt + Single URL
19:04
Everything Smart Home
Рет қаралды 271 М.
Home Assistant Remote Access using DuckDNS and LetsEncrypt
7:29
Smart Home Addict
Рет қаралды 52 М.
Home Assistant Remote Access Using Cloudflare
8:56
HassAssistant
Рет қаралды 29 М.
Proxy vs Reverse Proxy (Real-world Examples)
5:17
ByteByteGo
Рет қаралды 533 М.
Secure Remote Access to Home Assistant with Cloudflare Proxy
21:13
My iPhone 15 pro max 😱🫣😂
0:21
Nadir Show
Рет қаралды 1,4 МЛН
#samsung #retrophone #nostalgia #x100
0:14
mobijunk
Рет қаралды 13 МЛН
تجربة أغرب توصيلة شحن ضد القطع تماما
0:56
صدام العزي
Рет қаралды 63 МЛН