1. Output of caddy version:
I use docker image caddy:2
2. How I run Caddy:
a. System environment:
Ubuntu server 22.04
Docker 20.10.12
b. Command:
docker run --rm --netowrk host caddy
c. Service/unit/compose file:
Dockerfile
FROM caddy:2
WORKDIR /app
COPY Caddyfile .
CMD ["caddy", "run"]
d. My complete Caddy config:
allure.myproject.dev {
handle_path /14 {
rewrite /14 /latest-report
reverse_proxy :5058
}
handle_path /13 {
rewrite /13 /latest-report
reverse_proxy :5056
}
}
3. The problem I’m having:
I have 10 docker containers with allure-report. For example i use only two.
I need to proxy requests to specific ports, depending on the transmitted URI
For example:
GET allure.myproject.dev/14 → :5058/latest-report
GET allure.myproject.dev/13 → :5056/latest-report
But config in my Caddyfile dont work as i want. When i make request, i see blank page in response and status code 200. But when i change config to below, i see what i need (I make request on allure.myproject.dev/latest-report)
allure.myproject.dev {
reverse_proxy :5058
}
what should i do in my case? Cant find information.
4. Error messages and/or full log output:
…
5. What I already tried:
I tried next configurations:
(dont work)
allure.myproject.dev {
handle_path /14 {
reverse_proxy :5058/latest-report
}
(dont work, i see blank page)
allure.myproject.dev {
handle_path /14 {
rewrite /14 /latest-report
reverse_proxy :5058
}
}