404 on route if navigate directly to it but works fine if start from home
tuananh opened this issue · comments
I'm not sure where the problem is
suppose that i start at mydomain.com, the subsequent url loads fine (mydomain.com/about).
However, if i navigate directly to it, i got 404 (from nginx). I use nginx to serve the build directory from pwa build
Depends on what you've done.
Did you export? Aka, do you have a build/about/index.html
file?
If so, then the issue is in your nginx config (or equivalent).
If not, then you need to use a file server like sirv-cli
. I include it by default in init
templates. You need to make sure you have the --single
flag attached.
@lukeed sirv-cli
works for me. do you know what kind of configuration i need for nginx to make it work with spa?
Great! I haven't configured nginx in a long time, but this looks correct to me: https://stackoverflow.com/questions/7027636/nginx-send-all-requests-to-a-single-html-page
Lemme know how that goes / please post a solution if that wasn't it
Thanks!