Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95919

NGINX Reverse Proxy for HA

$
0
0

@ninjadog wrote:

Using latest Home Assistant installed as a Python venv .Was working fine.

I then installed NGINX and followed this guide:

However, I’m getting errors:

map $http_upgrade $connection_upgrade {
    default upgrade;
    ''      close;
}

server {
   # Update this line to be your domain
   server_name ninjadog.ddns.net;

   # These shouldn't need to be changed
   listen [::]:80 default_server ipv6only=off;
   return 301 https://$host$request_uri;
}

server {
    # Update this line to be your domain
    server_name ninjadog.ddns.net;

    # Ensure these lines point to your SSL certificate and key
    # ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
    # ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
    # Use these lines instead if you created a self-signed certificate
    ssl_certificate /etc/nginx/ssl/cert.pem;
    ssl_certificate_key /etc/nginx/ssl/key.pem;

    # Ensure this line points to your dhparams file
    ssl_dhparam /etc/nginx/ssl/dhparams.pem;


    # These shouldn't need to be changed
    listen [::]:443 ssl default_server ipv6only=off; # if your nginx version is >= 1.9.5 you can also add the "http2" flag here
    add_header Strict-Transport-Security "max-age=31536000; includeSubdomains";
    # ssl on; # Uncomment if you are using nginx < 1.15.0
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!PSK:!RC4";
    ssl_prefer_server_ciphers on;
    ssl_session_cache shared:SSL:10m;

    proxy_buffering off;

    location / {
        proxy_pass http://127.0.0.1:8123;
        proxy_set_header Host $host;
        proxy_redirect http:// https://;
        proxy_http_version 1.1;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $connection_upgrade;
    }
}

yields:

daz@pi:~ $ sudo nginx -t
nginx: [emerg] a duplicate default server for [::]:80 in /etc/nginx/sites-enabled/ninjadog.ddns.net:11
nginx: configuration file /etc/nginx/nginx.conf test failed

If I remove the first server block to comment it out

#server {
#  # Update this line to be your domain
#   server_name ninjadog.ddns.net;
#
#   # These shouldn't need to be changed
#   listen [::]:80 default_server ipv6only=off;
#  return 301 https://$host$request_uri;
#}

Yields

daz@pi:~ $ sudo nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

And in both cases, I still get errors from journalctl ,

Feb 28 18:55:13 pi hass[17186]: 2020-02-28 18:55:13 INFO (MainThread) [homeassistant.components.switch] Setting up switch.zwave
Feb 28 18:55:13 pi hass[17186]: 2020-02-28 18:55:13 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of mqtt. Setup failed for dependencies: http
Feb 28 18:55:13 pi hass[17186]: 2020-02-28 18:55:13 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform mqtt.light: Could not set up all dependencies.
Feb 28 18:55:13 pi hass[17186]: 2020-02-28 18:55:13 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of mqtt. Setup failed for dependencies: http
Feb 28 18:55:13 pi hass[17186]: 2020-02-28 18:55:13 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform mqtt.light: Could not set up all dependencies.
Feb 28 18:55:13 pi hass[17186]: 2020-02-28 18:55:13 INFO (MainThread) [homeassistant.setup] Setup of domain person took 0.8 seconds.
Feb 28 18:55:13 pi hass[17186]: 2020-02-28 18:55:13 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of onboarding. Setup failed for dependencies: auth, http
Feb 28 18:55:13 pi hass[17186]: 2020-02-28 18:55:13 ERROR (MainThread) [homeassistant.setup] Setup failed for onboarding: Could not set up all dependencies.
Feb 28 18:55:13 pi hass[17186]: 2020-02-28 18:55:13 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of mobile_app. Setup failed for dependencies: http, webhook
Feb 28 18:55:13 pi hass[17186]: 2020-02-28 18:55:13 ERROR (MainThread) [homeassistant.setup] Setup failed for mobile_app: Could not set up all dependencies.
Feb 28 18:55:13 pi hass[17186]: 2020-02-28 18:55:13 INFO (MainThread) [homeassistant.setup] Setup of domain light took 0.1 seconds.
Feb 28 18:55:13 pi hass[17186]: 2020-02-28 18:55:13 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of frontend. Setup failed for dependencies: api, auth, http, onboarding, search, system_log, websocket_api
Feb 28 18:55:13 pi hass[17186]: 2020-02-28 18:55:13 ERROR (MainThread) [homeassistant.setup] Setup failed for frontend: Could not set up all dependencies.
Feb 28 18:55:13 pi hass[17186]: 2020-02-28 18:55:13 INFO (MainThread) [homeassistant.components.light] Setting up light.zwave
Feb 28 18:55:13 pi hass[17186]: 2020-02-28 18:55:13 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of map. Setup failed for dependencies: frontend
Feb 28 18:55:13 pi hass[17186]: 2020-02-28 18:55:13 ERROR (MainThread) [homeassistant.setup] Setup failed for map: Could not set up all dependencies.
Feb 28 18:55:13 pi hass[17186]: 2020-02-28 18:55:13 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of logbook. Setup failed for dependencies: frontend, http
Feb 28 18:55:13 pi hass[17186]: 2020-02-28 18:55:13 ERROR (MainThread) [homeassistant.setup] Setup failed for logbook: Could not set up all dependencies.
Feb 28 18:55:14 pi hass[17186]: 2020-02-28 18:55:14 INFO (MainThread) [homeassistant.components.updater] Submitted analytics to Home Assistant servers. Information submitted includes {}
Feb 28 18:55:14 pi hass[17186]: 2020-02-28 18:55:14 INFO (MainThread) [homeassistant.setup] Setup of domain updater took 3.0 seconds.
Feb 28 18:55:14 pi hass[17186]: 2020-02-28 18:55:14 INFO (MainThread) [homeassistant.components.binary_sensor] Setting up binary_sensor.updater
Feb 28 18:55:14 pi hass[17186]: 2020-02-28 18:55:14 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of default_config. Setup failed for dependencies: automation, cloud, config, frontend, history, logbook, map, mobile_app, system_health, zeroconf
Feb 28 18:55:14 pi hass[17186]: 2020-02-28 18:55:14 ERROR (MainThread) [homeassistant.setup] Setup failed for default_config: Could not set up all dependencies.
Feb 28 18:55:14 pi hass[17186]: 2020-02-28 18:55:14 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of tts. Setup failed for dependencies: http
Feb 28 18:55:14 pi hass[17186]: 2020-02-28 18:55:14 ERROR (MainThread) [homeassistant.setup] Setup failed for tts: Could not set up all dependencies.
Feb 28 18:55:14 pi hass[17186]: 2020-02-28 18:55:14 INFO (MainThread) [homeassistant.bootstrap] Home Assistant initialized in 4.61s
Feb 28 18:55:14 pi hass[17186]: 2020-02-28 18:55:14 WARNING (MainThread) [homeassistant.bootstrap] Detected that frontend did not load. Activating safe mode
Feb 28 18:55:18 pi hass[17186]: 2020-02-28 18:55:18 INFO (MainThread) [homeassistant.bootstrap] Starting in safe mode

configuration.yaml

# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:

# Uncomment this if you are using SSL/TLS, running in Docker container, etc.
# http:
#   base_url: example.duckdns.org:8123

# Text to speech
tts:
  - platform: google_translate

group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

http:
  # For extra security set this to only accept connections on localhost if NGINX is on the same machine
  #server_host: 127.0.0.1
  # Update this line to be your domain
  base_url: https://ninjadog.ddns.net
  use_x_forwarded_for: true
  # You must set the trusted proxy IP address so that Home Assistant will properly accept connections
  # Set this to your NGINX machine IP, or localhost if hosted on the same machine.
  trusted_proxies: localhost


I dont understand , just following these guides ?? Please help

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 95919

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>