keycloak: Limit access to management console

This commit is contained in:
Erwin Boskma 2023-06-08 10:03:58 +02:00
parent 99f1c28019
commit 46919ae952
Signed by: erwin
SSH key fingerprint: SHA256:3F6Cm6I3erRqlBwEghZWAQl6eS5WrGTX1Vs/Evec1lQ

View file

@ -27,7 +27,14 @@ in
virtualHosts = { virtualHosts = {
"${config.services.keycloak.settings.hostname}" = { "${config.services.keycloak.settings.hostname}" = {
extraConfig = '' extraConfig = ''
reverse_proxy ${config.services.keycloak.settings.http-host}:${toString config.services.keycloak.settings.http-port} @public_or_allowed_remote {
not {
not path /realms/* /resources/* /js/* /robots.txt
not remote_ip 100.64.0.0/10 86.85.243.40/32
}
}
reverse_proxy @public_or_allowed_remote ${config.services.keycloak.settings.http-host}:${toString config.services.keycloak.settings.http-port}
''; '';
}; };
}; };