Sub-domain routing set up on Front-end or Backend?

Hi, we have a multi-tenant application running on docker/serverless architecture. Shall I do the sub-domain routing on Front-end (React) or Backend(Django)?