1. Caddy version (caddy version
):
v2.0.0 h1:pQSaIJGFluFvu8KDGDODV8u4/QRED/OPyIR+MWYYse8=
2. How I run Caddy:
I have a pfsense router that sends 80 and 443 to caddy on my newly installed ubuntu 20.04 server.
a. System environment:
ubuntu 20.04, systemd
b. Command:
I use systemd
ExecStart=/usr/bin/caddy run --environ --config /media/data/1/Caddyfile
c. Service/unit/compose file:
[Unit]
Description=Caddy
Documentation=https://caddyserver.com/docs/
After=network.target
[Service]
User=caddy
Group=caddy
ExecStart=/usr/bin/caddy run --environ --config /media/data/1/Caddyfile
ExecReload=/usr/bin/caddy reload --config /media/data/1/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:
(mycommon) {
try_files {path}.html {path}.htm {path}.php {path}
root * /var/www # Change path & syntax for your OS or your preferred location!
encode gzip
header / {
X-Content-Type-Options nosniff
X-XSS-Protection "1; mode=block"
Strict-Transport-Security "max-age=31536000;"
}
(mylocations) {
reverse_proxy /grafana* 127.0.0.1:3000 {
}
}
****.net {
tls ****@gmail.com # Email for Let's Encrypt Verification
log {
output file /media/data/1/caddy/access.log { # Change path syntax for your OS or your preferred location!
roll_size 10MiB # Rotate after 1 MB
roll_keep 5 # Keep at most 2 log files
}
}
log {
output file /media/data/1/caddy/errors.log { # Change path syntax for your OS or your preferred location!
roll_size 10MiB # Rotate after 1 MB
roll_keep 5 # Keep at most 2 log files
}
level ERROR
}
import mycommon # Import code snippet 1 defined above
import mylocations # Import code snippet 2 defined above
}
http://localhost http://10.0.2.40 {
import mycommon # Import code snippet 1 defined above
import mylocations # Import code snippet 2 defined above
}
3. The problem I’m having:
when using grafana in docker, I’m getting the error “*****.net redirected you too many times” in chrome. This set up previously worked in caddy using
proxy /grafana 127.0.0.1:3000 {
without /grafana
transparent
}
4. Error messages and/or full log output:
Not sure how to troubleshoot
5. What I already tried:
tried following the migration guide (other resources on the server work fine, this is the last one!), but unable to figure out the problem