Hello Home Assistant Community!
I’m quite new to Home Assistant (and nginx, for that matter), and I’m hoping you can help me.
PROBLEM: Within my LAN, when I try to access Home Assistant via nginx (http://10.0.1.2/homeassistant), I get the “Home Assistant had trouble connecting to the server” error. However, when accessing Home Assistant “directly” (http://10.0.1.12:8123/), everything seems fine.
My setup is as follows:
- I’m running nginx on an older Raspberry Pi 2 (as a reverse proxy)… with the intent of forwarding to Home Assistant running on a different Pi. This Raspberry Pi 2 has the standard Raspbian image.
- The second Raspberry Pi 3 has the latest Hassbian 1.1 image installed.
I’m using very simplistic config files (which may be the problem), based on examples I’ve seen on YouTube and other sources. FYI, I see this problem on two different computers (with different OS) on my LAN.
Here’s my nginx config file:
pi@raspberrypi2:/etc/nginx/sites-available $ cat ha-reverse-proxy.conf
server {
listen 80 default_server; listen [::]:80 default_server;
server_name _;
root /var/www/html; index index.html index.htm index.nginx-debian.html;
location /asus { proxy_pass http://10.0.1.9/; }
location /hassbian { proxy_pass http://10.0.1.12/; }
location /homeassistant { proxy_pass http://10.0.1.12:8123/; }
location /openhab {
proxy_pass http://10.0.1.9:8080/;
}
}
pi@raspberrypi2:/etc/nginx/sites-available $
(I’ve tried quite a few different things with this base config file, without success)
Here’s my Home Assistant config file:
pi@hassbian:/home/homeassistant/.homeassistant $ cat configuration.yaml
homeassistant:Name of the location where Home Assistant is running
name: Home
Location required to calculate the time the sun rises and sets
latitude: 31.9383
longitude: -81.3034Impacts weather/sunrise data (altitude above sea level in meters)
elevation: 6
metric for Metric, imperial for Imperial
unit_system: imperial
Pick yours from here: List of tz database time zones - Wikipedia
time_zone: America/New_York
Show links to resources in log and frontend
introduction:
Enables the frontend
frontend:
http:
Uncomment this to add a password (recommended!)
api_password: !secret my_api_password
Uncomment this if you are using SSL or running in Docker etc
base_url: example.duckdns.org:8123
Checks for available updates
updater:
Discover some devices automatically
discovery:
Allows you to issue voice commands from the frontend in enabled browsers
conversation:
Enables support for tracking state changes over time.
history:
View all events in a logbook
logbook:
Track the sun
sun:
Weather Prediction
sensor:
platform: yr
Text to speech
tts:
platform: google
mqtt:
broker: 10.0.1.12
port: 1883
client_id: home-assistant
username: !secret mqtt_username
password: !secret mqtt_password
pi@hassbian:/home/homeassistant/.homeassistant $
As I’m a noob, I’m hoping that you can point out any obvious stupidity on my part. I’ve been reading and trying so many different things, but nothing has helped. Thanks in advance for your time and feedback