Github user danfike commented on the issue:
https://github.com/apache/nifi/pull/2908
I actually also don't have an instance set up with a proxy either. I've
just been directly poking a simple unsecured NiFi instance (without a proxy)
using `curl`
I guess I'd expect it to work like `index.jsp`. Consider my simple
unsecured NiFi instance with no proxy set up. If I hit `http://hostname/`
(without a `/nifi` path), I get a simple page advising I probably meant to add
`/nifi` to the end (`index.jsp`). You can see this easily enough with `curl
http://hostname/`. Note the stylesheet paths all start with `/nifi/...`.
If I add `--header "X-ProxyContextPath: foo"` to my `curl` (note that I'm
still hitting NiFi directly; there is no actual proxy in place), you'll notice
there is *no change* to the stylesheet paths unless I "whitelist" the path
`foo` in `nifi.properties` at `nifi.web.proxy.context.path`. In that case, we'd
see the request response references stylesheet paths starting with
`/foo/nifi/...` This is what I'd expect given
https://nifi.apache.org/docs/nifi-docs/html/administration-guide.html#proxy_configuration
I'd expect requests that use `message-page.jsp` to do something similar.
I've been using `curl` to `GET /nifi-api/access/oidc/callback` on my unsecured
cluster with no proxy in front. It is just an easy way to land at the Message
Page and get it to render to test this behavior. I'd expect it to behave as
above.
(I'd embed the full shell text illustrating this but I don't have that
available at this moment).
I poked around this issue a bit earlier today. I *thought* I tried exactly
your fix (on top of 1.6.0 stable) and discovered that all message page renders
were failing because of `setAttribute("contextPath")` never being called in
this case. So no matter whether the header was absent, present and safe,
present and whitelisted, or present and unsafe, the requests all failed.
It looked to me like we'd need to add something to
https://github.com/apache/nifi/blob/46ce7aaa3298fa32d7f0c6beca9d45c5d43d3180/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/AccessResource.java#L805
that is similar to
https://github.com/apache/nifi/blob/46ce7aaa3298fa32d7f0c6beca9d45c5d43d3180/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-error/src/main/java/org/apache/nifi/web/filter/CatchAllFilter.java#L52-L53
But I'm not sure. And perhaps there are other references to the message
page that this wouldn't address.
---