Our frontend operates as a single page application (SPA), and we create a container to host it using nginx when we make local-up or make start-build-lumigator.
When using the app, the URL bar appears to show different paths (/datasets, /experiments) but they're all hosted from the same place. However, nginx doesn't know this and so if you attempt to browse directly to a page (rather than the root), or refresh a page you get a 404 not found.
This PR changes the default nginx daemon config so that it will reroute requests to the root index page. In order to add the single line:
try_files $uri $uri/ /index.html;
We need to supply the entire config file, as such we now have a copy of the default.conf modified that is copied by Docker.
What's changing
Our frontend operates as a single page application (SPA), and we create a container to host it using nginx when we
make local-up
ormake start-build-lumigator
.When using the app, the URL bar appears to show different paths (
/datasets
,/experiments
) but they're all hosted from the same place. However, nginx doesn't know this and so if you attempt to browse directly to a page (rather than the root), or refresh a page you get a 404 not found.This PR changes the default nginx daemon config so that it will reroute requests to the root index page. In order to add the single line:
We need to supply the entire config file, as such we now have a copy of the
default.conf
modified that is copied by Docker.How to test it
make start-lumigator-build
Additional notes for reviewers
http://localhost/experiments
Before:
After:
To check the default config file you can exec into a container then:
I already...