1. Caddy version (caddy version
):
2.0.0
2. How I run Caddy:
Caddy binary for windows 64bit .\caddy.exe run
a. System environment:
Windows 10 64-bit
b. Command:
.\caddy.exe run
2020/05/08 09:29:22.472 e[34mINFOe[0m using adjacent Caddyfile
run: adapting config using caddyfile: Caddyfile:4: unrecognized directive: matcher
PS D:\Federico\Projects\caddy_2.0.0_windows_amd64>
d. My complete Caddyfile or JSON config:
Caddyfile v2
example.test {
reverse_proxy / localhost:3000
matcher a {
path /api
}
rewrite match:a /
reverse_proxy match:a localhost:3001
}
tls off
}
Caddyfile v1 that I am trying to port to v2
example.test {
proxy / localhost:3000 {
transparent
}
proxy /api localhost:3001 {
without /api
}
tls off
}
3. The problem I’m having:
- The matcher for some reason isn’t recognized, contrary to what I learnt here
4. Error messages and/or full log output:
2020/05/08 09:29:22.472 e[34mINFOe[0m using adjacent Caddyfile
run: adapting config using caddyfile: Caddyfile:4: unrecognized directive: matcher
5. What I already tried:
I tried to learn what has been discussed
- here V2:rewrite+proxy
- and here v2: new directives for fast substring URI manipulation · Issue #2906 · caddyserver/caddy · GitHub
But overall so far I have been unable to translate my v1 Caddyfile to the v2 format, overall I’m smashing my head like never before. I loved Caddy for its simplicity and learnt how to setup the v1 Caddyfile in minutes while now it’s been two days that I’m browsing the forum, the documentation and GitHub to achieve the same in v2. (Sorry for the rant, I’m burned out for not being able to accomplish such a simple setup in v2).
If possible I’d rather not use the JSON configuration as of now, but I’m trying to understand it, eventually I know I will need it.