Closed faradaytrs closed 6 years ago
This seems to be an issue of the ordering in the middleware chain. cache
is before rewrite
(https://github.com/nicolasazrak/caddy/blob/master/caddyhttp/httpserver/plugin.go#L456) so it will cache the original url and not the rewritten one. I will make a few tests, if this is the problem I'll make a PR on the caddy repo to change that.
I tested that before and it was broken in both before and after rewrite, but you'd better test it again.
I just tested it and it doesn't work wherever you place it.
After investigating #22 it seems that both issues are the same. The ordering issue was my first guess but it seems it's not. I pushed a commit to master that fixes this issue. I cannot deploy it yet because of a problem in caddy infrastructure (https://github.com/mholt/caddy/issues/2106)
Has this been fixed?
It should be fixed by the latest master commit. But until caddy fixes https://github.com/mholt/caddy/issues/2106 I cannot deploy it to caddy website.
so should we just wait for a new caddy release?
Exactly, sadly I can't do anything right now. If you really need this fix you can compile your own version of caddy.
Nah, i think they are about to release new version
Problem is still there on caddy 0.10.13
I've just deployed the new version, try downloading caddy again
Thanks it worked!
More information here https://caddy.community/t/rewrite-nginx-rewrite-block-to-caddy/3582/26