I’m experimenting with kong in docker (docker kong:1.1) and added some services with routes (for example TheiaIDE and as route /testroute). The thing is, I can only access my backend when I add a trailing slash on the url like http://localhost:8000/testroute/.
When I try this with http://localhost:8000/testroute I simply get a white page and the console shows 404 error. This is bad for my because I want to secure my backend with some userparameters. Anything I forgot adding the services?
So to sum it up, since I’m trying to access a WebApp and not an API, I’ll get those 404 errors since my application is not really aware of this proxy situation and it tries to call it’s further files on standard root path?
In order to fix it (for the first case), I’d have to add a billion of additional routes for each file in the WebApp?
Is there a possible solution for this or should I try my luck with nginx+rewrite+proxy set-ups?
In did the src=“./bundle.js” in the home page of TheiaIDE is difficult to handle without a / in your url.
It depends what you want to do in terms of plugins, but testing it with http://localhost:8000/testroute/ (with the trailing /) should work to access all the webapp
I know this an old question but I’m facing the same issue and I was wondering if anyone could help.
I’m using Kong 2.1 with db-less configuration and one of the services that I’m proxying is a webapp.
For this webapp I’ve defined a route /hello/world/app because I’d like users to access the webapp through https://www.mydomain.com/hello/world/app and https://www.mydomain.com/hello/world/app/ (I really don’t know if this a good idea or bad practice)
Some users forget to add the trailing slash and it’s very confusing for them because instead of the webapp they get a blank page.
This is happens because, as @tr00mb said, the js and css files requests are missing part of the path. Specifically the js and css are requested like https://www.mydomain.com/hello/world/js/XXXX.js and https://www.mydomain.com/hello/world/css/XXXX.css instead of https://www.mydomain.com/hello/world/app/js/XXXX.js and https://www.mydomain.com/hello/world/app/css/XXXX.css.
How can I work around this? Is there a way to add a trailing slash to the request if it is missing?