Continuing the discussion from Attempting to reverse proxy to a folder w/ Caddy 2:
I am using the docker image caddy:2.3.0-alpine
.
The accepted solution from the previous discussion is this
but I am getting Error during parsing: Wrong argument count or unexpected line ending after 'rewrite'
when trying this
bar.foo.com {
header Cache-Control max-age=3600
rewrite /some/folder{uri}
reverse_proxy {
to https://other.com
}
}
And fair enough - looking at the docs it seems like rewrite
needs a 2nd arg. So I changed it to:
bar.foo.com {
header Cache-Control max-age=3600
rewrite * /some/folder{uri}
reverse_proxy {
to https://other.com
}
}
But now while a curl works just fine curl https://other.com/some/folder/FOO
on the upstream, caddy is giving a 421 status error for curl https://bar.foo.com/FOO
.
I don’t quite understand why. Any thoughts on how to debug this?