[ 
https://issues.apache.org/jira/browse/NIFI-14165?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Yuanhao Zhu updated NIFI-14165:
-------------------------------
    Description: 
The access to NIFI's root url are redirected to a wrong path when deployed 
behind a reverseproxy since the introduction of the new UI. 

For example, if the nifi instance is deployed locally, when access 
[https://localhost:9443|https://localhost:9443/] in the 1.x version of nifi, 
there will be a page showing that you may have mistyped and redirects to you 
[https://locahost:9443/nifi] , and this mechanism also works when nifi is 
deployed behind a reverseproxy, that the redirect url will take into account 
the parent path. e.g. a apache is deployed to listen at localhost and /nifi is 
configured to be point to our nifi instance, in this case. accessing 
[https://localhost/nifi] will bring you to that "Did you just mistyped" page 
and it will redirect you to [https://localhost/nifi/nifi] which is the correct 
path.

 

However, after the new UI is introduced, this behavior has changed, accessing 
the root url of the nifi instance will directly result in a HTTP 302 response 
but the redirect location does not consider the parent path at all. In this 
case, if the nifi instance is deployed behind a reverseproxy, like we mentioned 
in the example above. Accessing the URL [https://localhost/nifi] will get a 
redirect response which the location is still /nifi and in the end results in 
404 not found or in our case, an infinite redirection loop

 

Ideally the HTTP302 response should consider the parent path and the location 
header of the response should contain it

  was:
The access to NIFI's root url are redirected to a wrong path since the 
introduction of the new UI. 

For example, if the nifi instance is deployed locally, when access 
[https://localhost:9443|https://localhost:9443/] in the 1.x version of nifi, 
there will be a page showing that you may have mistyped and redirects to you 
[https://locahost:9443/nifi] , and this mechanism also works when nifi is 
deployed behind a reverseproxy, that the redirect url will take into account 
the parent path. e.g. a apache is deployed to listen at localhost and /nifi is 
configured to be point to our nifi instance, in this case. accessing 
[https://localhost/nifi] will bring you to that "Did you just mistyped" page 
and it will redirect you to [https://localhost/nifi/nifi] which is the correct 
path.

 

However, after the new UI is introduced, this behavior has changed, accessing 
the root url of the nifi instance will directly result in a HTTP 302 response 
but the redirect location does not consider the parent path at all. In this 
case, if the nifi instance is deployed behind a reverseproxy, like we mentioned 
in the example above. Accessing the URL [https://localhost/nifi] will get a 
redirect response which the location is still /nifi and in the end results in 
404 not found or in our case, an infinite redirection loop

 

Ideally the HTTP302 response should consider the parent path and the location 
header of the response should contain it


> Access to NIFI root url redirects to wrong path behind a reverseproxy
> ---------------------------------------------------------------------
>
>                 Key: NIFI-14165
>                 URL: https://issues.apache.org/jira/browse/NIFI-14165
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Core UI
>    Affects Versions: 2.0.0, 2.1.0
>            Reporter: Yuanhao Zhu
>            Priority: Major
>
> The access to NIFI's root url are redirected to a wrong path when deployed 
> behind a reverseproxy since the introduction of the new UI. 
> For example, if the nifi instance is deployed locally, when access 
> [https://localhost:9443|https://localhost:9443/] in the 1.x version of nifi, 
> there will be a page showing that you may have mistyped and redirects to you 
> [https://locahost:9443/nifi] , and this mechanism also works when nifi is 
> deployed behind a reverseproxy, that the redirect url will take into account 
> the parent path. e.g. a apache is deployed to listen at localhost and /nifi 
> is configured to be point to our nifi instance, in this case. accessing 
> [https://localhost/nifi] will bring you to that "Did you just mistyped" page 
> and it will redirect you to [https://localhost/nifi/nifi] which is the 
> correct path.
>  
> However, after the new UI is introduced, this behavior has changed, accessing 
> the root url of the nifi instance will directly result in a HTTP 302 response 
> but the redirect location does not consider the parent path at all. In this 
> case, if the nifi instance is deployed behind a reverseproxy, like we 
> mentioned in the example above. Accessing the URL [https://localhost/nifi] 
> will get a redirect response which the location is still /nifi and in the end 
> results in 404 not found or in our case, an infinite redirection loop
>  
> Ideally the HTTP302 response should consider the parent path and the location 
> header of the response should contain it



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to