To clarify my earlier message (I’ve edited it to clear the confusion), that you’ve linked: you can surely do it, but this will require significant work. It’s not just about the configuration of your proxy, you’d also have to review/update the way the internal link structure works.
I’m not sure if someone on this forum has done this, hopefully they’ll share their experience if they have!
If we go down the route of a market.domain.com instead of domain.com/market, would this alleviate it as it technically can be treated as a root domain? Trying to weigh out all my options