-
Notifications
You must be signed in to change notification settings - Fork 7
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
Handle the path redirection in gateway #94
Comments
Sounds good to me, as long as it's generic enough (not hardcoded like it was in the security proxy) |
I don't see any benefit to have it in the gateway more than in the frontend webserver configuration (okay, the front webserver could proxy to whatever service, regardless it is geOrchestra or another thing, but considering that we know that we are deploying a geOrchestra, why should it be agnostic to this point ?). In any ways, it should already be possible to configure the gw accordingly, relying on the spring cloud gateway configuration: |
Because there are many ways to configure a webserver, traefik it's this way, nginx this way and so on. If we have this functionality built in the gateway, we wouldn't need to adapt the redirect based on the kind of webserver used. It would make our lives much easier. Maybe we could introduce a parameter that can be enabled or disabled. If enabled, the gateway adds a final slash to the first path. This way we do not interfere with the default behavior of gateway. |
I'd say it makes sense to put in geOrchestra as much as we can of the geOrchestra-specific logic, so +1 for me if there is a clean solution to implement it in the GW. As @edevosc2c put it, it would be one less thing to worry about and possibly misconfigure on deployment. |
I found out that if you pass the correct host header to the final application (#102 (comment)). For example geonetwork if you pass the correct host header then geonetwork itself will gladly redirect you to the correct URL with the final slash. On gateway without preserveHostHeader:
With preserveHostHeader:
Now working on trying to tell the application that it needs to redirect to HTTPS. It's usually through the header But at least we get a correct redirection from the app itself, not from the gateway!!!! |
Currently, at least in the docker composition of georchestra, it's traefik that handle the redirection when a final slash is missing for the component.
For example, to redirect from
/geonetwork
to/geonetwork/
so that geonetwork is actually served to the user when it goes to/geonetwork
, not a 404 not found error page.I'm proposing to implement this logic instead in the gateway. This way, it won't be needed anymore to have this logic inside the final webserver (traefik or NGINX or other).
The benefit are:
I'm not sure what this represents in terms of work to do, nor if it's really feasible. But I'm very well sure that it would benefit the community as a whole, the redirect to a final slash that is not handled is the number one thing that it's always forget when deploying a new geOrchestra platform.
What do you think @groldan @pmauduit @fvanderbiest @jeanmi151 @jeanpommier @f-necas @danduk82
The text was updated successfully, but these errors were encountered: