1. Caddy version (caddy version
):
(devel)
2. How I run Caddy:
I’m running Caddy in a Docker container. Here’s the docker-compose.yml
:
version: '3'
services:
caddy-web:
image: caddy/caddy
ports:
- 80:80
- 443:443
volumes:
- ../commerceowl/html/:/var/www/html/
- ./config/Caddyfile:/etc/caddy/Caddyfile
logging:
options:
max-size: 50m
a. System environment:
Docker version 19.03.1, build 74b1e89
docker-compose version 1.17.1, build unknown
b. Command:
docker-compose up
c. Service/unit/compose file:
docker-compose.yml
:
version: '3'
services:
caddy-web:
image: caddy/caddy
ports:
- 80:80
- 443:443
volumes:
- ../commerceowl/html/:/var/www/html/
- ./config/Caddyfile:/etc/caddy/Caddyfile
logging:
options:
max-size: 50m
d. My complete Caddyfile or JSON config:
{
email hgezim@example.com
acme_ca https://acme-v02.api.letsencrypt.org/directory
#acme_ca https://acme-staging-v02.api.letsencrypt.org/directory
}
https://www.commerceowl.com {
file_server {
root /var/www/html
}
try_files {path}.html {path}
encode gzip zstd
log
}
commerceowl.com, sellwithrecipes.com, www.sellwithrecipes.com {
redir https://www.commerceowl.com{uri}
}
https://help.commerceowl.com {
# this is erroring for some reason
uri /en/* strip_prefix /en
redir https://www.commerceowl.com/support{uri}
}
3. The problem I’m having:
I get this error when running docker-compose up
:
caddy-web_1 | 2021/06/19 13:02:52.047 INFO using provided configuration {"config_file": "/etc/caddy/Caddyfile", "config_adapter": "caddyfile"}
caddy-web_1 | run: adapting config using caddyfile: /etc/caddy/Caddyfile:22: unrecognized directive: uri
caddy_caddy-web_1 exited with code 1
4. Error messages and/or full log output:
$ docker-compose up
Creating network "caddy_default" with the default driver
Creating caddy_caddy-web_1 ...
Creating caddy_caddy-web_1 ... done
Attaching to caddy_caddy-web_1
caddy-web_1 | 2021/06/19 13:02:52.047 INFO using provided configuration {"config_file": "/etc/caddy/Caddyfile", "config_adapter": "caddyfile"}
caddy-web_1 | run: adapting config using caddyfile: /etc/caddy/Caddyfile:22: unrecognized directive: uri
caddy_caddy-web_1 exited with code 1
$
5. What I already tried:
I tried leaving the URL without a matcher: uri strip_prefix /en
and I get the same error:
$ docker-compose up
Creating network "caddy_default" with the default driver
Creating caddy_caddy-web_1 ...
Creating caddy_caddy-web_1 ... done
Attaching to caddy_caddy-web_1
caddy-web_1 | 2021/06/19 13:08:16.792 INFO using provided configuration {"config_file": "/etc/caddy/Caddyfile", "config_adapter": "caddyfile"}
caddy-web_1 | run: adapting config using caddyfile: /etc/caddy/Caddyfile:22: unrecognized directive: uri
caddy_caddy-web_1 exited with code 1
$