diff --git a/nixos/modules/services/security/oauth2-proxy.nix b/nixos/modules/services/security/oauth2-proxy.nix index 756857524f14..d0a5051c7b76 100644 --- a/nixos/modules/services/security/oauth2-proxy.nix +++ b/nixos/modules/services/security/oauth2-proxy.nix @@ -629,7 +629,7 @@ in } ]; - warnings = lib.mkIf (cfg.reverseProxy -> cfg.trustedProxyIP == [ ]) [ + warnings = lib.mkIf (cfg.reverseProxy && cfg.trustedProxyIP == [ ]) [ '' When config.services.oauth2-proxy.reverseProxy is enabled, configure config.services.oauth2-proxy.trustedProxyIP to the IPs or CIDR range(s) of the reverse proxies that are allowed to send X-Forwarded-* headers. If you leave it unset, OAuth2 Proxy currently trusts all source IPs for backwards compatibility, which means a client that can reach OAuth2 Proxy directly may be able to spoof forwarded headers.