[ 
https://issues.apache.org/jira/browse/KNOX-897?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15905320#comment-15905320
 ] 

Attila Kanto commented on KNOX-897:
-----------------------------------

hi [~sumit.gupta], hi [~moresandeep],

I think that is the expected behaviour. If I understand the question correctly:
- not using LB / reverse proxy at the front of Knox
- Knox listens on port 8443 on host local.somehost.com
- User connects directly to Knox specifying X-Forwarded-Host header, but not 
specifying X-Forwarded-Port in other words the users sets these:

{code}
Header[X-Forwarded-Host]=local.somehost.com
Header[X-Forwarded-Proto]=https
{code}

In this case I expect that it shall not work, since user set the 
X-Forwarded-Host to local.somehost.com which basically means 
local.somehost.com:443. I do expect that in this case every subsequent url must 
point to local.somehost.com:443 which will cause 404, since  Knox listens on 
port 8443 

If user specifies the such headers then it must be consequent with the Knox 
setup. E.g if knox listens on 8443 then the header shall look like this:
{code}
Header[X-Forwarded-Host]=local.somehost.com:8443
Header[X-Forwarded-Proto]=https
{code}

Attila

> X-Forwarded-Port is incorrectly determined
> ------------------------------------------
>
>                 Key: KNOX-897
>                 URL: https://issues.apache.org/jira/browse/KNOX-897
>             Project: Apache Knox
>          Issue Type: Bug
>    Affects Versions: 0.11.0
>            Reporter: Attila Kanto
>             Fix For: 0.12.0
>
>         Attachments: gateway.log, knox-897.patch, Screen Shot 2017-03-01 at 
> 14.44.03.png
>
>
> If the client fills out the following headers:
> {code}
> Header[X-Forwarded-Host]=local.somehost.com
> Header[X-Forwarded-Proto]=https
> {code}
> And does not specify the port number in X-Forwarded-Host since it uses the 
> the default port, then Knox automatically populates X-Forwarded-Port header 
> field with its own local port e.g. 8443 instead of the default 443 which 
> results in page not founds (see screenshot and log).



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to