1. The problem I’m having:
I’m trying to make a reverse proxy to localhost on a specific route in my app. Let’s say we have a route named /app that should forward to localhost:3000 with the following code:
localhost {
handle /app {
reverse_proxy: http://localhost:3000
}
}
Then caddy forwards /app to my app while it expects / to be the root. I tried to use the strip_prefix function like this:
localhost {
handle /app {
uri strip_prefix /app
reverse_proxy: http://localhost:3000
}
}
But then redirects don’t work. Should I do something to fix them or does caddy have some more built in way to handle this better?
2. Error messages and/or full log output:
Not relevant
3. Caddy version:
v2.10.2 h1:g/gTYjGMD0dec+UgMw8SnfmJ3I9+M2TdvoRL/Ovu6U8=
4. How I installed and ran Caddy:
Not relevant
a. System environment:
Not relevant
b. Command:
Not relevant
d. My complete Caddy config:
Already mentioned