Proxied home-assistant and added SSL

This commit is contained in:
Nickiel12 2025-01-25 14:55:34 -08:00
parent 66172fc546
commit 5da4a5c8ea

View file

@ -3,7 +3,7 @@
{ {
services.home-assistant = { services.home-assistant = {
enable = true; enable = true;
openFirewall = true; openFirewall = false;
# List extraComponents here to be installed. The names can be found here: # List extraComponents here to be installed. The names can be found here:
# https://github.com/NixOS/nixpkgs/blob/master/pkgs/servers/home-assistant/component-packages.nix # https://github.com/NixOS/nixpkgs/blob/master/pkgs/servers/home-assistant/component-packages.nix
@ -24,12 +24,23 @@
]; ];
config = { config = {
http = {
server_port = 8123;
trusted_proxies = [ "127.0.0.1" ];
use_x_forwarded_for = true;
};
homeassistant = {
name = "Alaska";
temperature_unit = "F";
};
}; };
}; };
services.nginx.virtualHosts = { services.nginx.virtualHosts = {
"home-assistant.nickiel.net" = { "home-assistant.nickiel.net" = {
forceSSL = true;
enableACME = true;
locations."/" = { locations."/" = {
proxyPass = "http://127.0.0.1:8123"; proxyPass = "http://127.0.0.1:8123";
proxyWebsockets = true; proxyWebsockets = true;