Struggling to set up Nginx addon in HA container setup

Hey Folks,

I have reached the point of needing to get Nginx working in order to add on yet more sensors. However, due to the RasperryPi the system runs on also being needed to run pi-hole, I opted for the Docker version of HA. This has served me well but I cannot get it to play nicely with the nginx add-on. I have poured over the forums and feel like I am almost there, but I am clearly missing something. Is anyone able to offer any pointers?

Here is my current setup and status:

Currently working: internal URL works fine
Currently not working: external URL does not load - it just sits loading forever

configuration.yaml:

homeassistant:
  external_url: "https://MYDOMAIN.duckdns.org"
  internal_url: "http://192.168.86.194:8123"

http:
#  ssl_certificate: /ssl/fullchain.pem
#  ssl_key: /ssl/privkey.pem
  use_x_forwarded_for: true
  trusted_proxies:
    - 192.168.86.0/24  # Local Lan
    - 172.30.33.0/24  # Docker network

docker inspect -f ‘{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}’ NGINX-ADDON

172.30.33.2

Nginx addon config

certfile: fullchain.pem
cloudflare: false
customize:
  active: false
  default: nginx_proxy_default*.conf
  servers: nginx_proxy/*.conf
domain: MYDOMAIN.duckdns.org
hsts: max-age=31536000; includeSubDomains
keyfile: privkey.pem

Nginx log (from HA addon)

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[18:39:34] INFO: Running nginx...

Rather than using the add-on, try SWAG, coupled with your choice of DuckDNS update client.

1 Like

Thanks! This led me to the solution. Using SWAG (and learning a lot about proxies along the way!), I found out the issue is my ISP blocking port 443. Using a SWAG setup that I could confirm was working locally helped me debug the issue.

Problem solved by using the initial setup but having my router forward the external port 444 to the internal port 443.