1. Caddy version (caddy version
):
2.1.1
2. How I run Caddy:
a. System environment:
Ubuntu 18.04.2 LTS
b. Command:
I use systemd.
c. Service/unit/compose file:
# caddy.service
#
# For using Caddy with a config file.
#
# Make sure the ExecStart and ExecReload commands are correct
# for your installation.
#
# WARNING: This service does not use the --resume flag, so if you
# use the API to make changes, they will be overwritten by the
# Caddyfile next time the service is restarted. If you intend to
# use Caddy's API to configure it, add the --resume flag to the
# `caddy run` command or use the caddy-api.service file instead.
[Unit]
Description=Caddy
Documentation=https://caddyserver.com/docs/
After=network.target
[Service]
User=caddy2
Group=caddy2
ExecStart=/usr/local/bin/caddy run --environ --config /etc/caddy2/Caddyfile
ExecReload=/usr/local/bin/caddy reload --config /etc/caddy2/Caddyfile
TimeoutStopSec=5s
LimitNOFILE=1048576
LimitNPROC=512
PrivateTmp=true
ProtectSystem=full
AmbientCapabilities=CAP_NET_BIND_SERVICE
[Install]
WantedBy=multi-user.target
d. My complete Caddyfile or JSON config:
git.bec-systems.com {
rewrite /explore /
reverse_proxy localhost:3000
}
3. The problem I’m having:
With Caddy1, I could use the following Caddyfile to redirect /explore to /. With the above config in Caddy2, I can’t get this to work.
Caddyfile for caddy1 (works):
git.bec-systems.com {
proxy / localhost:3000
rewrite /explore /
}
4. Error messages and/or full log output:
Jul 10 19:07:27 git3 caddy[13018]: {"level":"error","ts":1594408047.454012,"logger":"http.handlers.reverse_proxy","msg":"aborting with incomplete response","error":"context canceled"}
I get this message every time I load a page.
5. What I already tried:
I tried removing the rewrite line, and does not seem to make any difference with the above error.