Hi again,
I’m partially answering to my own question: usage of the preserve_host attribute in the API declaration enables to keep the “external” Host (i.e. uiserver in my example above) in the Location redirect header, instead of the Kong host (kong). That’s already a good step !.. but, I now have an issue on the path !
To explain this, I need to go deeper into the explanations of my urls, sorry for that… Indeed if I take the plain UI Server, it is always using a common root path /theUI and all links and redirect URLs are under this /theUI path.
I have no issue if I create a Kong API with the uris field set to “/theUI” and with strip_uri set to false… but I don’t want this because “theUI” keywork is a reserved keyword for my application: I cannot use it explicitly as root path for the UI server 
So I would like to declare an API in Kong with a uris field set to “/ui”, the UI Server being now accessible when I use http://kong:8000/ui/theUI (strip_uri set to true)… but then, the value of the Location Header of the response is not good: it is http://kong:8000/theUI/xxx: the host is managed properly… but not the path because I lost the /ui/ due to the strip_uri being set to true, and then no way to navigate the redirected URI through Kong (Kong does not have API declared on /theUI; it is declared on /ui) !
What about setting strip_uri to false? This does not work because this time this is the very first request that will not route to my UI Server (because the upstream URI http://uiserver:8080/theUI/ui does not exist
)
As a summary, it looks I would need a new preserve_stripped_path parameter that would add back in the Location header of the response the part of the URI that has been cut/stripped when processing the request!
And maybe not only in the Location header; this is true also for all URLs that may have been returned as links of the UI’s html or php or… returned pages! It looks like the “reverse proxy pass” feature of an Apache server…
And more than that, isn’t it the same issue if I have a REST endpoint (I’m no longer talking about a UI at all) that returns JSONs containing URLs of other resources: the resource server might consider the usage of the Host header for the domain name, but no way to consider the part of the path that has been cut by the “URI stripping mechanism” of Kong ! Only Kong can add back this cut/stripped part of the urls…
Any idea to addess this issue on the path?