honestly not sure about GA https. but didnt work till I added the http block. In fact I’'ve been using a chromcast to issue TTS notifications for almost a year. when I set up the proxy last week it stopped working. Today after setting up http it started working again.
Agreed. Just odd that if I have the default configs for Ngnix set and it doesn’t authorize with https, then adding in that http block allows it to work, makes you wonder.
Ah nice. I run nginx directly (letsencrypt too), but if I get some spare time think I’ll switch to this.
Couple of docker tweaks I would do (for additional security):
tie it down to a specific ip (if you have multiple network interfaces) -p 192.168.11.200:80:80
read-only mode! I imagine the linuxserver containers won’t support running in read-only mode though, as they modify the filesystem on startup (setting the UID and GID). I always run all my containers in read-only mode if possible (including homeassistant) --read-only
lock down any privileges --security-opt="no-new-privileges:true"
What’s really odd is that unless you are forwarding port 80 through your router, that block wouldn’t do anything…and GA wouldn’t be able to use http over https…
Thanks @juan11perez for this detailed instructions … this is exactly what this board needs. Some of us, although somewhat technically inclined are not experts in security. Passing your knowledge to other is greatly appreciated.
I can follow, in my mind, how this thing works but I do have a question.
How does the following line know how to associate Hass to it’s IP Address and port, and also respectively for “conf” or “graf” etc. to https://hass.mydomain.duckdns.org?
Same for other subdomains like Node-red, Configurator etc. etc.
I must be missing something in my understanding on how one can get access to these other docket installs.
OK, but how does “hass” translates to my Home Assistant install … and “graf” to my Grafana install etc. etc. How do I know what names I need to put in my SUBDOMAIN statement? Is it related to my docker container_name? This still seems a little fuzzy for me.
I am using Traefik as a reverse proxy. It handles Let’s Encrypt certificates (and auto-renewal). I don’t understand why people got through the hassle of using Nginx. Traefik is super-easy and secure.
It doesn’t. It merely points hass.domain.com to your public IP.
you add whatever subdomains you want to use for various purposes. You don’t NEED any other domain names.
no
As someone who has been running NGINX servers for 6+ years, I find it super simple…since I am running other websites (not just proxied instances), it’s just natural.
@berniebl the Subdomain command provides the instruction to the letsencrypt element of the container to issue the associated Subject Alternative Name (SAN) certificate(s).
After that when you configure your default file in Nginx, the server block points the url to wherever you decide.
for example below block points https://conf.mydomain.duckdns.org to proxy_pass http://192.168.1.XXX:3218;
CONFIGURATOR
server {
listen 443 ssl;
root /config/www;
index index.html index.htm index.php;
server_name conf.mydomain.duckdns.org;
include /config/nginx/ssl.conf;
client_max_body_size 0;
location / {
auth_basic "Restricted";
auth_basic_user_file /config/nginx/.htpasswd;
include /config/nginx/proxy.conf;
proxy_pass http://192.168.1.XXX:3218;
}
Could you post a working configuration file for traefik. I’d like to try it out. I might be able to figure it out (maybe…) but if you already have a working config then why reinvent the wheel!
I have no idea what happened (I also didn’t test from an external IP initially) but I got everything working and even got GA to sync. Now when I tried to reach my site via an external IP, I get nothing. I reverted to test back to my site:port and its fine. Any ideas? Do I need to allow all in the location settings?