authelia: fix getUpstreamFromInstance
This commit is contained in:
parent
9139163470
commit
9438fc6957
@ -24,16 +24,18 @@ let
|
||||
instance:
|
||||
let
|
||||
inherit (config.services.authelia.instances.${instance}.settings) server;
|
||||
inherit (server) port;
|
||||
host =
|
||||
if server.host == "0.0.0.0" then
|
||||
port = server.port or 9091;
|
||||
host = server.host or "127.0.0.1";
|
||||
|
||||
targetHost =
|
||||
if host == "0.0.0.0" then
|
||||
"127.0.0.1"
|
||||
else if lib.hasInfix ":" server.host then
|
||||
else if lib.hasInfix ":" host then
|
||||
throw "TODO IPv6 not supported in Authelia server address (hard to parse, can't tell if it is [::])."
|
||||
else
|
||||
server.host;
|
||||
host;
|
||||
in
|
||||
"http://${host}:${toString port}";
|
||||
"http://${targetHost}:${toString port}";
|
||||
|
||||
# use this when reverse proxying to authelia (and only authelia because i
|
||||
# like the nixos recommended proxy settings better)
|
||||
|
Loading…
x
Reference in New Issue
Block a user