Open Kenya-West opened 1 month ago
If I get rid of Caddyfile
in Caddy's docker-compose.yml:
environment:
- CADDY_INGRESS_NETWORKS=caddy
- - CADDY_DOCKER_CADDYFILE_PATH=/config/Caddyfile
- then it works just fine. What is the problem with Caddyfile
?
I checked Caddy's container logs and now I get it: in-memory's Caddyfile
has duplicated domain name:
kek.example.com
kek.example.com {
handle_path /xui-dashboard*
reverse_proxy 172.18.0.3:54444
handle_path /sub*
reverse_proxy 172.18.0.3:2099
rewrite * /sub{uri}
handle_path /xui-vless-ws*
reverse_proxy 172.18.0.3:1488
}
This is the result of merging the pre-defined Caddyfile
and the X-UI container which has the same domain defined.
How to avoid this?
caddy.1_handle_path: "/sub/*"
caddy.1_reverse_proxy: "{{http://xui:2096}}"
caddy.2_handle_path: "/${XUI_VLESS_WS_PATH}"
caddy.2_reverse_proxy: "{{http://xui:${XUI_VLESS_WS_PORT}}}"
This isn't right, you need to nest reverse_proxy
inside of handle_path
, by doing caddy.1_handle_path.reverse_proxy
I run your Caddy:
with
Caddyfile
:All works fine until I try to add another container in
caddy
network like so:It messages me with this error:
What is even this? It cannot be even googled. I know that something is being wrong with (the resulted one?) Caddyfile, but I do not know what is exactly. The id of container points to the docker-compose file above, so
xui
container has provided something tocaddy
with wrong attributes