Multi root container

I have searched a lot but did not find any results, please help

i have multi container with dokcer compose i want to bind each domain with one of them but for domain2 return 404

this work fine

domain1.ir {
        root * /workspace/public
        file_server
        encode gzip
        php_fastcgi domain1:9000 {
            root /workspace/public/
        }
}

but not work in domain2

domain2.ir {
        root * /workspace2/public
        file_server
        encode gzip
        php_fastcgi domain2:9000 {
            root /workspace2/public/
        }
}

What confuses me is that I don’t know how to separate the root for each container.
I even put it in two separate workspaces, but I didn’t get an answer

We can’t answer this without the information in the template. Can you please fill it out?

1 Like

only use caddy 2.7.6

We need all of this

<!--
Hi. Welcome! :)

- YOU MUST USE THIS TEMPLATE TO GET HELP. DO NOT DELETE IT.
- Please use code blocks: https://superuser.com/editing-help
- We want to help you, but if you ignore or skip questions in this template, we will just ask you to fill it out anyway.
- If your post is hard to read, people will not want to help.

Thanks!
-->

## 1. The problem I'm having:
<!-- What are you trying to do? What isn't working? Please describe the issue thoroughly enough so that anyone can reproduce the exact behavior you're seeing. Be as specific as possible. Use `curl -vL` to show example requests. DO NOT USE WEB BROWSERS HERE. Browsers have subtle caching behaviours which can make testing difficult. -->




## 2. Error messages and/or full log output:
<!--
Please DO NOT REDACT any information except credentials. Leave domain names intact!
Please DO NOT POST TRUNCATED LOG LINES as systemd is notorious for this.
Please USE THIS COMMAND TO VIEW LOGS with systemd:
    $ journalctl -u caddy --no-pager | less +G`
Please DO NOT USE WEB BROWSERS. Use `curl -vL` instead.
Please ENABLE DEBUG MODE FIRST by adding "debug" to the global options of your Caddyfile. See https://caddyserver.com/docs/caddyfile/options#debug for an example.
-->



## 3. Caddy version:
<!--
If you installed Caddy as a Linux package, run `caddy version`.
If you're running Caddy with Docker Compose, run `docker-compose exec caddy caddy version`.
DO NOT say "latest" or "v2", as this is not a specific version.
Please check that you're already running the latest version listed at https://github.com/caddyserver/caddy/releases, since your issue might have already been fixed in a previous release.
-->




## 4. How I installed and ran Caddy:
<!--
Please provide all of the relevant information and **DO NOT REDACT** anything except credentials. This is a rule. We cannot help you otherwise! Your exact domain names (etc.) are significant. Thank you!
We recommend using one of the official installation methods found at https://caddyserver.com/docs/install.
-->

### a. System environment:
<!-- OS, architecture, relevant versions, systemd? Docker? etc. -->




### b. Command:
<!--
Commands are what you type into a terminal, i.e. the command you use to run Caddy.
Please read https://caddyserver.com/docs/running to understand the recommended commands to run Caddy, depending on your installation method.
-->


### c. Service/unit/compose file:
<!--
If using Docker/systemd/Kubernetes/make etc.
Delete the code block below if not relevant.
-->


### d. My complete Caddy config:
<!--
DO NOT REDACT anything except credentials.
LEAVE DOMAIN NAMES INTACT.
If using the Caddyfile:
  - Please use `caddy fmt` to make your config more legible.
  - Review https://caddyserver.com/docs/caddyfile/concepts#structure
-->


### 5. Links to relevant resources:
<!-- Optional, but can help get us on the same page quickly. -->

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.