-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Reverse proxy to a service while re-writing the request path #3209
Comments
Of course:
should do what you need. You might not even need
So, that's correct. Do it before reverse proxying. If you have any further questions, please ask on our forums. Thanks! |
Works great, thanks! Though you'll want to take off the
Also, is that bit from the documentation incorrect or am I just reading it wrong? Should it point to the route/redir docs page? |
Sure, customize to suit your needs. Again, you might not even need
Which bit, the quoted bit? It's correct. The proxy does not rewrite requests. That's what the rewrite directive is for. |
Although, that particular result is a bug... hmm 🤔 In the meantime, a rewrite to |
If a placeholder in the path component injects a query string such as the {http.request.uri} placeholder is wont to do, we need to separate it out from the path.
@anoadragon453 I believe I have fixed the bug that caused the weird results you saw, in 809e727. Please build from that commit or download one of the CI artifacts and let me know if it works for you! (You should be able to use |
@mholt That commit works great, thank you! |
Hi @mholt i have the same requirement but in my case it’s an external url i.e., a proxy pass. |
Did you finally achieve that? I am struggling with the same problem. |
@tckb @migueldinacode I would probably file a new issue with some details, as the original case here as been fixed. |
As Matt wrote above, please ask your usage questions on our community forums https://caddy.community/. This issue is closed and resolved, therefore the not right place to ask. |
In caddy's documentation, it's stated that:
I have a setup which requires something along the lines of this. I have users coming to a URL:
And a service running on the same box that I'm reverse proxying to that must have a prefix before any paths it receives. Essentially, it's expecting:
So... I essentially need to prefix
/service
to the query path of requests, but as I understand it caddy doesn't support this while reverse proxying.Is there another way around this situation? This can be done in other webservers but I want to use Caddy :D
The text was updated successfully, but these errors were encountered: