mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 04:19:19 -08:00
feat(nginx): enable option for vhost/location
This commit is contained in:
parent
a6fced79d5
commit
8f227a1bc5
7 changed files with 116 additions and 31 deletions
|
|
@ -9,12 +9,16 @@
|
|||
listenPorts = {
|
||||
http = { };
|
||||
https.ssl = true;
|
||||
hass = mkIf (!home-assistant.enable) { port = mkDefault home-assistant.config.http.server_port; };
|
||||
hass = {
|
||||
enable = !home-assistant.enable;
|
||||
port = mkDefault home-assistant.config.http.server_port;
|
||||
extraParameters = [ "default_server" ];
|
||||
};
|
||||
};
|
||||
in {
|
||||
config.services.nginx.virtualHosts = {
|
||||
home-assistant = {
|
||||
inherit name listenPorts;
|
||||
inherit name;
|
||||
locations."/" = {
|
||||
proxy = {
|
||||
websocket.enable = true;
|
||||
|
|
@ -33,7 +37,7 @@ in {
|
|||
websocket.enable = true;
|
||||
headers.enableRecommended = true;
|
||||
};
|
||||
proxyPass = mkIf (!home-assistant.enable) (mkDefault
|
||||
proxyPass = (mkDefault
|
||||
nginx.virtualHosts.home-assistant.locations."/".proxyPass
|
||||
);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue