the above replace-uri - that actually does replace the url however the moment you interact with it it reverts back… so i can imagine i am missing some session handling and more than likely how its handling some of the headers.
can you tell me why you need to replace the URL?
Each tenant has a unique login page portal.company.com/login/tenantN after they logged in they will redirect back to portal.company.com is it true?
Now you want to give customers a CNAME to portal.company.com for this just you need to handle it on origin servers.
or I don’t understand your case at all
So far this redirects as expected. We have done this in two different cases. We also added an permanent https redirect for http to https… and then we also did a beg path to redirect the tenant as well…
I won’t deny there are probably better ways to do this but for the time being this seemed to solve our problems. If we were to move to F5 this may eliminate the need for all this manual labor.
The app that we are using now shows in the logs that the request is coming from portal.company2.com but allows authentication and allows the sub tenant to work properly.
If anyone has recommendations of better methods then i am open to all and any recommendations.