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

Redirect requests to resources under the GUI path that aren’t static resources to the index.html file #5306

Closed
kleinfreund opened this issue Nov 14, 2022 · 3 comments · Fixed by #5357
Assignees
Labels
good first issue Good for newcomers kind/feature New feature triage/accepted The issue was reviewed and is complete enough to start working on it

Comments

@kleinfreund
Copy link
Contributor

kleinfreund commented Nov 14, 2022

Description

Problem

Currently, the server is not configured to redirect non-asset resources back to the index.html file that serves our Vue application. This breaks part of the Vue application’s routing since changing the app’s URLs to no longer use hashes. Specifically, reloading a page doesn’t work. In-application navigations work.

Solution

Redirect all requests made to resources under the GUI path (e.g. /gui/*, configurable via #5295) to the GUI’s index.html file (e.g. /gui/index.html) if they’re not handled by already (like static assets or the config.json asset added in #5295).

If that solution isn’t feasible, I’ll have to revert the changes to the URL structure.

See also https://router.vuejs.org/guide/essentials/history-mode.html.

@kleinfreund kleinfreund added triage/pending This issue will be looked at on the next triage meeting kind/feature New feature labels Nov 14, 2022
@jakubdyszkiewicz jakubdyszkiewicz added triage/accepted The issue was reviewed and is complete enough to start working on it and removed triage/pending This issue will be looked at on the next triage meeting labels Nov 14, 2022
@jakubdyszkiewicz
Copy link
Contributor

Triage: let's do 301

@jakubdyszkiewicz jakubdyszkiewicz added the good first issue Good for newcomers label Nov 14, 2022
@kleinfreund
Copy link
Contributor Author

Maybe we don’t need to look at the static file handling at all. As long as we can detect requests to the GUI path (which since #5295 is configurable) when handling requests after static file handling is done and before the piece of logic for error handling runs (i.e. which produces the standard 404 response), we should be able to redirect anything under $guiUrl to $guiUrl/index.html because all other static resources would be handled by the earlier layer, no?

@lahabana
Copy link
Contributor

lahabana added a commit to lahabana/kuma that referenced this issue Nov 22, 2022
- remove config.json
- use a templated index.html to dynamically set base paths
- serve index.html whenever the path doesn't have an extension

Fix kumahq#5306

Signed-off-by: Charly Molter <charly.molter@konghq.com>
lahabana added a commit to lahabana/kuma that referenced this issue Nov 22, 2022
- remove config.json
- use a templated index.html to dynamically set base paths
- serve index.html whenever the path doesn't have an extension

Fix kumahq#5306

Signed-off-by: Charly Molter <charly.molter@konghq.com>
@lahabana lahabana self-assigned this Nov 23, 2022
lahabana added a commit that referenced this issue Nov 24, 2022
- remove config.json
- use a templated index.html to dynamically set base paths
- serve index.html whenever the path points to a file that doesn't exist

Fix #5306

Signed-off-by: Charly Molter charly.molter@konghq.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers kind/feature New feature triage/accepted The issue was reviewed and is complete enough to start working on it
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants