1. The problem I’m having:
Here is my Caddyfile snippet:
:80 {
handle /api/* {
reverse_proxy http://myserver:3030
}
handle_path /app1/* {
reverse_proxy http://myserver:3030
}
handle_path /app2/* {
reverse_proxy http://myserver:3030
}
}
Since the proxy server is same, So I want to use named matcher to simplifie these Caddyfile, such as:
:80 {
@myserver {
path /api/*
path /app1/*
path /app2/*
}
handle @myserver {
reverse_proxy http://myserver:3030
}
}
But this is not right because app1 and app2 was use handle_path .
I searched the document but can’t find the right way to achive this.
2. Error messages and/or full log output:
PASTE OVER THIS, BETWEEN THE ``` LINES.
Please use the preview pane to ensure it looks nice.
3. Caddy version:
caddy 2.7.4
4. How I installed and ran Caddy:
a. System environment:
ubuntu 22.04
b. Command:
PASTE OVER THIS, BETWEEN THE ``` LINES.
Please use the preview pane to ensure it looks nice.
c. Service/unit/compose file:
PASTE OVER THIS, BETWEEN THE ``` LINES.
Please use the preview pane to ensure it looks nice.
d. My complete Caddy config:
PASTE OVER THIS, BETWEEN THE ``` LINES.
Please use the preview pane to ensure it looks nice.