react-router-dome nginx routing problem for dynamic string at the end of URL

example url reactjs appp route: domain.de/home/%7Brandomstring%7D

https://domain.de/home/123uwb2j3u2

https://domain.de/home/128283283s

randomstring is actually an id that i use.

Question:
How can i use nginx to point to this domain.de/home/128283283s route.

reactjs build files are under

/var/www/html/

I tried following nginx config:

location \~\* (.\*/home/)(.+)$
{
return 301 https://domain.de/anotherRoute( ; #not really what i want
}

No success with the following too

location \~\* (.\*/home/)(.+)$
{
alias   /var/www/html/;
index  index.html index.js;
try_files $uri $uri/ /index.html?$args;

}

Read more here: Source link