-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Description
Hey ! I'm trying to configure a pretty simple X-Accel-Redirect kind of setup under Caddy 2.6.2, but think I encountered an issue that prevents me to do so.
My stripped down Caddyfile looks like this:
localhost {
reverse_proxy service_a:5000 {
@accel header X-Accel-Redirect *
handle_response @accel {
rewrite * {rp.header.X-Accel-Redirect}
reverse_proxy service_b:5000
}
}
}
The service_a returns a response with a header X-Accel-Redirect: /hello?some=param&some_other=param. This is be picked by Caddy and rewritten so that this query is handled by service_b. The rewrite of the path works, but the GET params get swallowed and are not visible to service_b where I only see /hello.
It works as expected when I hardcode the same value in the caddy file like this (which IMO should be 100% equivalent).
localhost {
reverse_proxy service_a:5000 {
@accel header X-Accel-Redirect *
handle_response @accel {
rewrite * /hello?some=param&some_other=param
reverse_proxy service_b:5000
}
}
}
Just to understand what's happening, I tried with some variants such as rewrite * /hello?{rp.header.X-Accel-Redirect} with just the paramters in the header. In this case, service_b sees http://localhost/hello?some%3Dparam%26some_other%3Dparam, so not good either.
Seems some rogue urlencoding happens, but I couldn't find anything in the doc about that.
Any pointer about how to solve this ? I searched through the issues but could not find anything about this exactly.