pkzxs123
(重八 朱)
November 11, 2023, 4:29pm
1
I have a local service. I want use Caddy to route to it by a path. Here is my config
placeholder.suffix {
tls ./fullchain.pem ./privkey.pem
handle_path /mypath* {
rewrite * /{uri}
reverse_proxy localhost:3000 {
header_up X-Real-IP {remote}
header_up X-Forwarded-Proto {scheme}
}
}
}
This works well, but this local service use some static url to obtain assets. For example, it will request file from placeholder.suffix/static/some.js
. Then, this fails. Is there a way to rewrite this request to placeholder.suffix/mypath/static/some.js
, therefore it could correctly goto local service? Thanks!
matt
(Matt Holt)
November 11, 2023, 5:00pm
2
Check out this article:
Have you ever tried to reverse proxy an app into its own little subfolder of your domain name?
Makes things neat, doesn’t it? Using example.com/foo/ for one app, example.com/bar/ for another. If you’re coming here from one of the selfhosted communities, you might be thinking along the lines of example.com/sonarr/, example.com/radarr/ etc.
Chances are, you’ve tried some configuration along these lines:
example.com {
redir /sonarr /sonarr/
handle_path /sonarr/* {
reverse_proxy localhost…
Either the app has to support being served out of a subfolder (WordPress does, for example) or you have to do some intense response manipulation.
system
(system)
Closed
January 10, 2024, 4:29pm
3
This topic was automatically closed after 60 days. New replies are no longer allowed.