[DOC] Best approach to run a single page application with client-side routing? #2062
Unanswered
spwoodcock
asked this question in
Help
Replies: 1 comment
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
Awesome project 🎉
SERVE_FILES
.Example config:
Proposed solution (optional)
Option 1: Modify serve-files.conf
The serve-files.conf file is as such:
bunkerweb/src/common/core/misc/confs/server-http/serve-files.conf
Lines 1 to 6 in 00e7529
try_files $uri $uri/ =404
-->try_files $uri $uri/ /index.html =404
Option 2: Override the 404
In the config above, it should be possible to add environment variable:
This would override the 404 response and point it to
index.html
, so that the SPA can handle the client-side routing.I'm interested to hear if others have encountered this, or if there is an approach I have not considered that would be preferred 🙏
Beta Was this translation helpful? Give feedback.
All reactions