Login/logout pages don't redirect properly when NiFi is deployed on a custom URL prefix (context). For example when deploying NiFi on custom URL like https://nifi-host/mynifi (using HAPROXY, setting nifi.web.proxy.host=mynifi), UI works perfectly (via https://nifi-host/mynifi/nifi/). Problem is with login/logout pages, which both don't seem to honor X-ProxyContextPath and after successfull login/logout they both redirect to https://nifi-host/nifi.
After some investigations made, the problem on login page seems to be in nf-login.js containing hardcoded url in lines 121-125:
where on logout page, redirect url is composed purely using HttpServletResponse in LogoutFilter.java, 53 (without examining X-ProxyContextPath):
Found a similar issue with OpenID fixed few version ago, I am not sure if it is somehow related: