vhost: added host

This commit is contained in:
Giulio De Pasquale 2023-06-05 04:44:33 +02:00
parent 6389d1950a
commit 7f2c129ea9

View File

@ -91,6 +91,12 @@ in
default = false;
};
host = mkOption {
type = types.str;
description = "The host for the location.";
default = "127.0.0.1";
};
port = mkOption {
type = types.int;
description = "The port number for the location.";
@ -126,7 +132,7 @@ in
enableACME = true;
locations = mapAttrs
(path: location: {
proxyPass = "http://127.0.0.1:${toString location.port}";
proxyPass = "http://${location.host}:${toString location.port}";
proxyWebsockets = location.proxyWebsockets;
extraConfig = ''
${optionalString location.allowLan "deny 10.0.0.1;"}