Unable to connect to home assistant outside

Hello,

I’m trying to acces outside to my HA. I did it with Home Assistant in a docker container, duck DNS, and nginx in docker. nginx generated SSL certificates, it works in local, but if I go with my phone or anything else on https://mydomain.duckdns.org, I have :

I searched on forums but most of them are in add-on, and some idears did’nt work.

In yaml I have :

http:
  server_port: 8123
  ssl_certificate: /opt/nginxproxymanager/letsencrypt/live/npm-25/fullchain.pem
  ssl_key: /opt/nginxproxymanager/letsencrypt/live/npm-25/privkey.pem
  cors_allowed_origins:
    - https://google.com
    - https://www.home-assistant.io
  use_x_forwarded_for: true
  trusted_proxies:
    - 172.21.0.2
  ip_ban_enabled: false
  login_attempts_threshold: 5

And gives me error :

s6-rc: info: service fix-attrs successfully started

s6-rc: info: service legacy-cont-init: starting

s6-rc: info: service legacy-cont-init successfully started

s6-rc: info: service legacy-services: starting

services-up: info: copying legacy longrun home-assistant (no readiness notification)

s6-rc: info: service legacy-services successfully started

2023-08-26 18:53:58.292 WARNING (SyncWorker_3) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant

2023-08-26 18:53:58.501 ERROR (MainThread) [homeassistant.config] Invalid config for [http]: not a file for dictionary value @ data['http']['ssl_certificate']. Got '/opt/nginxproxymanager/letsencrypt/live/npm-25/fullchain.pem'

not a file for dictionary value @ data['http']['ssl_key']. Got '/opt/nginxproxymanager/letsencrypt/live/npm-25/privkey.pem'. (See /config/configuration.yaml, line 59). Please check the docs at https://www.home-assistant.io/integrations/http

2023-08-26 18:53:58.507 ERROR (MainThread) [homeassistant.setup] Setup failed for http: Invalid config.

2023-08-26 18:53:58.512 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of api. Setup failed for dependencies: http

2023-08-26 18:53:58.514 ERROR (MainThread) [homeassistant.setup] Setup failed for api: (DependencyError(...), 'Could not setup dependencies: http')

2023-08-26 18:53:58.515 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of auth. Setup failed for dependencies: http

2023-08-26 18:53:58.517 ERROR (MainThread) [homeassistant.setup] Setup failed for auth: (DependencyError(...), 'Could not setup dependencies: http')

2023-08-26 18:53:58.518 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of config. Setup failed for dependencies: http

2023-08-26 18:53:58.520 ERROR (MainThread) [homeassistant.setup] Setup failed for config: (DependencyError(...), 'Could not setup dependencies: http')

2023-08-26 18:53:58.521 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of diagnostics. Setup failed for dependencies: http

2023-08-26 18:53:58.523 ERROR (MainThread) [homeassistant.setup] Setup failed for diagnostics: (DependencyError(...), 'Could not setup dependencies: http')

2023-08-26 18:53:58.524 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of file_upload. Setup failed for dependencies: http

2023-08-26 18:53:58.526 ERROR (MainThread) [homeassistant.setup] Setup failed for file_upload: (DependencyError(...), 'Could not setup dependencies: http')

2023-08-26 18:53:58.527 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of repairs. Setup failed for dependencies: http

2023-08-26 18:53:58.529 ERROR (MainThread) [homeassistant.setup] Setup failed for repairs: (DependencyError(...), 'Could not setup dependencies: http')

2023-08-26 18:53:58.530 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of websocket_api. Setup failed for dependencies: http

2023-08-26 18:53:58.532 ERROR (MainThread) [homeassistant.setup] Setup failed for websocket_api: (DependencyError(...), 'Could not setup dependencies: http')

2023-08-26 18:53:58.534 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of image_upload. Setup failed for dependencies: http

2023-08-26 18:53:58.535 ERROR (MainThread) [homeassistant.setup] Setup failed for image_upload: (DependencyError(...), 'Could not setup dependencies: http')

2023-08-26 18:53:58.537 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of search. Setup failed for dependencies: websocket_api

2023-08-26 18:53:58.538 ERROR (MainThread) [homeassistant.setup] Setup failed for search: (DependencyError(...), 'Could not setup dependencies: websocket_api')

2023-08-26 18:53:58.540 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of analytics. Setup failed for dependencies: api, websocket_api

2023-08-26 18:53:58.541 ERROR (MainThread) [homeassistant.setup] Setup failed for analytics: (DependencyError(...), 'Could not setup dependencies: api, websocket_api')

2023-08-26 18:53:58.543 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of person. Setup failed for dependencies: image_upload

2023-08-26 18:53:58.544 ERROR (MainThread) [homeassistant.setup] Setup failed for person: (DependencyError(...), 'Could not setup dependencies: image_upload')

2023-08-26 18:53:58.546 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of onboarding. Setup failed for dependencies: analytics, auth, http, person

2023-08-26 18:53:58.547 ERROR (MainThread) [homeassistant.setup] Setup failed for onboarding: (DependencyError(...), 'Could not setup dependencies: analytics, auth, http, person')

2023-08-26 18:53:58.549 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of frontend. Setup failed for dependencies: api, auth, config, diagnostics, file_upload, http, onboarding, repairs, search, websocket_api

2023-08-26 18:53:58.550 ERROR (MainThread) [homeassistant.setup] Setup failed for frontend: (DependencyError(...), 'Could not setup dependencies: api, auth, config, diagnostics, file_upload, http, onboarding, repairs, search, websocket_api')

2023-08-26 18:53:59.800 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of network. Setup failed for dependencies: websocket_api

2023-08-26 18:53:59.803 ERROR (MainThread) [homeassistant.setup] Setup failed for network: (DependencyError(...), 'Could not setup dependencies: websocket_api')

2023-08-26 18:53:59.805 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of webhook. Setup failed for dependencies: http

2023-08-26 18:53:59.807 ERROR (MainThread) [homeassistant.setup] Setup failed for webhook: (DependencyError(...), 'Could not setup dependencies: http')

2023-08-26 18:53:59.809 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of usb. Setup failed for dependencies: websocket_api

2023-08-26 18:53:59.810 ERROR (MainThread) [homeassistant.setup] Setup failed for usb: (DependencyError(...), 'Could not setup dependencies: websocket_api')

2023-08-26 18:53:59.930 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of zeroconf. Setup failed for dependencies: network, api

2023-08-26 18:53:59.932 ERROR (MainThread) [homeassistant.setup] Setup failed for zeroconf: (DependencyError(...), 'Could not setup dependencies: network, api')

2023-08-26 18:53:59.934 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of cloud. Setup failed for dependencies: http, webhook

2023-08-26 18:53:59.935 ERROR (MainThread) [homeassistant.setup] Setup failed for cloud: (DependencyError(...), 'Could not setup dependencies: http, webhook')

2023-08-26 18:53:59.937 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of bluetooth. Setup failed for dependencies: usb

2023-08-26 18:53:59.939 ERROR (MainThread) [homeassistant.setup] Setup failed for bluetooth: (DependencyError(...), 'Could not setup dependencies: usb')

2023-08-26 18:53:59.941 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of ssdp. Setup failed for dependencies: network

2023-08-26 18:53:59.943 ERROR (MainThread) [homeassistant.setup] Setup failed for ssdp: (DependencyError(...), 'Could not setup dependencies: network')

2023-08-26 18:54:00.307 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of map. Setup failed for dependencies: frontend

2023-08-26 18:54:00.311 ERROR (MainThread) [homeassistant.setup] Setup failed for map: (DependencyError(...), 'Could not setup dependencies: frontend')

2023-08-26 18:54:00.313 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of alexa. Setup failed for dependencies: http

2023-08-26 18:54:00.315 ERROR (MainThread) [homeassistant.setup] Setup failed for alexa: (DependencyError(...), 'Could not setup dependencies: http')

2023-08-26 18:54:00.317 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of upnp. Setup failed for dependencies: network, ssdp

2023-08-26 18:54:00.319 ERROR (MainThread) [homeassistant.setup] Setup failed for upnp: (DependencyError(...), 'Could not setup dependencies: network, ssdp')

2023-08-26 18:54:00.323 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of logbook. Setup failed for dependencies: frontend, http

2023-08-26 18:54:00.325 ERROR (MainThread) [homeassistant.setup] Setup failed for logbook: (DependencyError(...), 'Could not setup dependencies: frontend, http')

2023-08-26 18:54:00.328 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of mqtt. Setup failed for dependencies: file_upload, http

2023-08-26 18:54:00.331 ERROR (MainThread) [homeassistant.setup] Setup failed for mqtt: (DependencyError(...), 'Could not setup dependencies: file_upload, http')

2023-08-26 18:54:00.333 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of thread. Setup failed for dependencies: zeroconf

2023-08-26 18:54:00.335 ERROR (MainThread) [homeassistant.setup] Setup failed for thread: (DependencyError(...), 'Could not setup dependencies: zeroconf')

2023-08-26 18:54:00.337 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of stream. Setup failed for dependencies: http

2023-08-26 18:54:00.339 ERROR (MainThread) [homeassistant.setup] Setup failed for stream: (DependencyError(...), 'Could not setup dependencies: http')

2023-08-26 18:54:00.343 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of my. Setup failed for dependencies: frontend

2023-08-26 18:54:00.346 ERROR (MainThread) [homeassistant.setup] Setup failed for my: (DependencyError(...), 'Could not setup dependencies: frontend')

2023-08-26 18:54:00.349 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of conversation. Setup failed for dependencies: http

2023-08-26 18:54:00.350 ERROR (MainThread) [homeassistant.setup] Setup failed for conversation: (DependencyError(...), 'Could not setup dependencies: http')

2023-08-26 18:54:00.352 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of apple_tv. Setup failed for dependencies: zeroconf

2023-08-26 18:54:00.355 ERROR (MainThread) [homeassistant.setup] Setup failed for apple_tv: (DependencyError(...), 'Could not setup dependencies: zeroconf')

2023-08-26 18:54:00.357 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of media_source. Setup failed for dependencies: http

2023-08-26 18:54:00.359 ERROR (MainThread) [homeassistant.setup] Setup failed for media_source: (DependencyError(...), 'Could not setup dependencies: http')

2023-08-26 18:54:00.363 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of panel_iframe. Setup failed for dependencies: frontend

2023-08-26 18:54:00.365 ERROR (MainThread) [homeassistant.setup] Setup failed for panel_iframe: (DependencyError(...), 'Could not setup dependencies: frontend')

2023-08-26 18:54:00.368 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of application_credentials. Setup failed for dependencies: auth, websocket_api

2023-08-26 18:54:00.370 ERROR (MainThread) [homeassistant.setup] Setup failed for application_credentials: (DependencyError(...), 'Could not setup dependencies: auth, websocket_api')

2023-08-26 18:54:00.372 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of system_health. Setup failed for dependencies: http

2023-08-26 18:54:00.374 ERROR (MainThread) [homeassistant.setup] Setup failed for system_health: (DependencyError(...), 'Could not setup dependencies: http')

2023-08-26 18:54:00.376 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of hacs. Setup failed for dependencies: http, websocket_api, frontend, repairs

2023-08-26 18:54:00.378 ERROR (MainThread) [homeassistant.setup] Setup failed for custom integration hacs: (DependencyError(...), 'Could not setup dependencies: http, websocket_api, frontend, repairs')

2023-08-26 18:54:00.380 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of history. Setup failed for dependencies: http

2023-08-26 18:54:00.382 ERROR (MainThread) [homeassistant.setup] Setup failed for history: (DependencyError(...), 'Could not setup dependencies: http')

2023-08-26 18:54:00.384 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of tts. Setup failed for dependencies: http

2023-08-26 18:54:00.385 ERROR (MainThread) [homeassistant.setup] Setup failed for tts: (DependencyError(...), 'Could not setup dependencies: http')

2023-08-26 18:54:00.387 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of stt. Setup failed for dependencies: http

2023-08-26 18:54:00.389 ERROR (MainThread) [homeassistant.setup] Setup failed for stt: (DependencyError(...), 'Could not setup dependencies: http')

2023-08-26 18:54:00.689 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of energy. Setup failed for dependencies: websocket_api, history

2023-08-26 18:54:00.690 ERROR (MainThread) [homeassistant.setup] Setup failed for energy: (DependencyError(...), 'Could not setup dependencies: websocket_api, history')

2023-08-26 18:54:00.692 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of assist_pipeline. Setup failed for dependencies: conversation, stt, tts

2023-08-26 18:54:00.694 ERROR (MainThread) [homeassistant.setup] Setup failed for assist_pipeline: (DependencyError(...), 'Could not setup dependencies: conversation, stt, tts')

2023-08-26 18:54:00.701 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of sonos. Setup failed for dependencies: ssdp

2023-08-26 18:54:00.710 ERROR (MainThread) [homeassistant.setup] Setup failed for sonos: (DependencyError(...), 'Could not setup dependencies: ssdp')

2023-08-26 18:54:00.725 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of mobile_app. Setup failed for dependencies: http, webhook, person, websocket_api

2023-08-26 18:54:00.728 ERROR (MainThread) [homeassistant.setup] Setup failed for mobile_app: (DependencyError(...), 'Could not setup dependencies: http, webhook, person, websocket_api')

2023-08-26 18:54:00.816 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of homekit. Setup failed for dependencies: http, network

2023-08-26 18:54:00.830 ERROR (MainThread) [homeassistant.setup] Setup failed for homekit: (DependencyError(...), 'Could not setup dependencies: http, network')

2023-08-26 18:54:02.961 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of camera. Setup failed for dependencies: http

2023-08-26 18:54:02.964 ERROR (MainThread) [homeassistant.setup] Setup failed for camera: (DependencyError(...), 'Could not setup dependencies: http')

2023-08-26 18:54:02.994 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of default_config. Setup failed for dependencies: application_credentials, assist_pipeline, bluetooth, cloud, conversation, energy, frontend, history, logbook, map, media_source, mobile_app, my, network, person, ssdp, stream, system_health, usb, webhook, zeroconf

2023-08-26 18:54:02.996 ERROR (MainThread) [homeassistant.setup] Setup failed for default_config: (DependencyError(...), 'Could not setup dependencies: application_credentials, assist_pipeline, bluetooth, cloud, conversation, energy, frontend, history, logbook, map, media_source, mobile_app, my, network, person, ssdp, stream, system_health, usb, webhook, zeroconf')

I don’t know why he doesnt know the path, and don’t know how to know the good path to avoid this error… With this, even in local it doesnt work.

And if I put only in yaml, local works but no outside with https://mydomain.duckdns.org

http:
  server_port: 8123
  use_x_forwarded_for: true
  trusted_proxies:
    - 172.21.0.2

Is your port forwarding set up correctly on the router?

Either you use nginx for your certificates, and forward to HA, or you leave nginx out of your setup and let HA handle SSL. Nginx forwarding to a SSL enabled HA does not work.