-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
[ADMIN] fix path concat to support admin serving at / path #17147
base: main
Are you sure you want to change the base?
Conversation
👌 |
This PR looks really great. I think this would greatly improve path routing. |
Deployment failed with the following error:
|
I have a feeling this might break a few things in recent updates. @dekinderfiets have you tested this in a deployed environment with something like nginx and no-prefix base path? |
I tried it all the variations mentioned above:
with an Nginx instance (Kubernetes Ingress) and it worked. |
Ah I don't think we need that package, I was more so worried about the various nginx proxy (or generic proxy application) handling. |
@derrickmehaffy Ok, so what else we need to merge this PR? 😃 |
Need to get engineers approval, I'll mention it to them in our internal slack |
Experimental release in progress for testing: https://github.com/strapi/strapi/actions/runs/6224864249 |
Experimental version for testing: |
This looks good for me and seemed to work fine, but since it's part of the core path routing if someone else can do some more thorough QA to double-check me to make sure we don't break anything as a side effect ( @derrickmehaffy do you have time?) that would be great, then we can merge 🚀 |
Yeah I'll do some of my prod type testing with Nginx and caddy to see how well it works in a real world use-case. |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Hi @derrickmehaffy, could you please let me know if you had a chance to check if the PR works in a real world use-case? Thank you! |
What does it do?
Fixed the concatenation of paths.
When
strapi.config.admin.path
value is/
(According to the docs, it should be supported),koa-static
serving throws anAssertionError
since the path is cannot be registered because the registered route is//:path*
instead of/:path*
.Why is it needed?
It is needed so we can support serving the admin at
https://example.com/
and not only athttps://example.com/something
How to test it?
To reproduce the error, just set the
url
key atconfig/admin(.ts/.js)
to/
and start Strapi.Related issue(s)/PR(s)
A few days ago someone faced the same issue at the forums:
https://forum.strapi.io/t/routing-for-separate-subdomains-for-api-and-admin-page/29177