Getting 404 for dynamic links for React app if first link is not index.html
I have a simple react blog that uses react router (either BrowserRouter or HashRouter). If you visit mydomain.com/ and navigate from there all works fine, because index.html is served and entire React app is bootstrapped so it knows how to handle url changes.
However, when I open new window and directly navigate to any other page (that is not index.html), gitlab server probably searches for that page in 'public' folder and since it doesn't find it it gives me 404 :/
This is very inconvenient as blog posts pages are much more important than root page.
Is there any yml configuration where I tell gitlab server to 'serve' index page and React will take over routing from there?
ps. you can check the code here: https://gitlab.com/jasofalcon/blog.jasofalcon and you can check behaviour by going first to blog.jasofalcon.com/about . (and then try to go blog.jasofalcon.com and navigate on top bar to About)