-
Notifications
You must be signed in to change notification settings - Fork 284
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
Bug: registerWebInterface option 'ignoreTrailingSlash' causes redirect to absolute URL, breaking reverse-proxies #2705
Comments
This problem only seems to occur when a @path("/web/checkout")
class CheckoutController {
// Use the /web path so that it does not strictly require JWT before being loaded.
@path("/") // The same thing happens with @path("")
void getCheckout() {
string priceLookupKey = "funnel-service-standard";
render!("checkout.dt", priceLookupKey);
} |
If the reverse proxy setup sets the |
Interesting.
According to the docs I can find (https://www.envoyproxy.io/docs/envoy/v1.24.1/configuration/http/http_conn_man/headers#x-forwarded-for), the I wasn't aware that vibe could make use of these headers, let me dig further and make sure they are there if possible. |
I enabled the
While debugging, the only information the server running on port 8082 receives, that even hints that the reverse proxy is on 8180 is via the |
vibe.d/web/vibe/web/web.d
Lines 216 to 228 in fee3872
When an HTTP GET request arrives, e.g. "/configs" that is missing a trailing slash, the code above causes this to be a redirect to "/configs/". However, because the redirect URL is an absolute URL, this causes errors when the server is behind a reverse proxy.
For example:
Either, the redirect should use a relative URL, or the redirect step should be entirely skipped and the WebInterface function should simply be called directly.
The text was updated successfully, but these errors were encountered: