Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

404 on route if navigate directly to it but works fine if start from home #43

Closed
tuananh opened this issue Sep 20, 2018 · 3 comments
Closed
Labels
question Item is a question, not an issue

Comments

@tuananh
Copy link

tuananh commented Sep 20, 2018

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

@lukeed
Copy link
Owner

lukeed commented Sep 20, 2018

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.

@tuananh
Copy link
Author

tuananh commented Sep 21, 2018

@lukeed sirv-cli works for me. do you know what kind of configuration i need for nginx to make it work with spa?

@lukeed
Copy link
Owner

lukeed commented Sep 21, 2018

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!

@lukeed lukeed closed this as completed Sep 21, 2018
@lukeed lukeed added the question Item is a question, not an issue label Sep 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Item is a question, not an issue
Projects
None yet
Development

No branches or pull requests

2 participants