-
Notifications
You must be signed in to change notification settings - Fork 78
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
Fallback for multiple subdirectories #56
Comments
Hi 👋 |
Yes, will try to get it working on the weekend. |
Feel free to ping me if needed |
So I tried a few things but I haven't found a solution that I think is good/works yet.
But I feel like I may be way off path, so hints would be appreciated. Edit: Might have a new idea: Split requestPath at '/' and remove parts of the requestPath until the requestPath exists on the filesystem. This way nothing would have to be hardcoded and and as soon as the requested file exists it could be served. Lets say the request is |
I use goStatic in a docker/traefik setup where goStatic serves as errorpages and a catch-all. So any route that isn't matched by traefik will get routed to goStatic. The setup works well.
Traefik will handle:
doesnotexist.example.com
The goStatic fallback will handle:
doesnotexist.example.com/doesnotexist
The only case which currently isn't being handled nicely is:
doesnotexist.example.com/doesnotexist/doesnotexist
(or even more subdirs).If there are multiple subdirectories the html page will be shown, but any css/js/images will fail to load.
I have tried both setting
-fallback /index.html
and-fallback index.html
, the result seems to be the same.My file structure inside the container looks as follows:
Is there a way to redirect all requests to a specified path and not just one level of subdirectories?
Am I missing something else?
The text was updated successfully, but these errors were encountered: