1. Caddy version (caddy version
): Caddy 2
2. How I run Caddy: using a systemd service file
a. System environment:
Proxmox LXC containerb. Command:
none
c. Service/unit/compose file:
[Unit]
Description=Caddy Web Server
Documentation=https://caddyserver.com/docs/
After=network.target
[Service]
User=http
Group=http
ExecStart=/usr/bin/caddy run --config /etc/caddy/caddy.json --environ
ExecReload=/usr/bin/caddy reload --config /etc/caddy/caddy.json
TimeoutStopSec=5s
LimitNOFILE=1048576
LimitNPROC=512
# Hardening options
PrivateTmp=true
ProtectSystem=strict
PrivateDevices=true
ProtectHome=true
ReadWritePaths=/var/lib/caddy /var/log/caddy
AmbientCapabilities=CAP_NET_BIND_SERVICE
CapabilityBoundingSet=CAP_NET_BIND_SERVICE
NoNewPrivileges=true
ProtectKernelTunables=true
ProtectKernelModules=true
ProtectControlGroups=true
LockPersonality=true
[Install]
WantedBy=multi-user.target
d. My complete Caddyfile or JSON config: nextcloud related config
{
"handle": [
{
"handler": "subroute",
"routes": [
{
"handle": [
{
"handler": "reverse_proxy",
"upstreams": [
{
"dial": "10.10.10.230:80"
}
]
}
]
}
]
}
],
"match": [
{
"host": [
"cloud.myshinydomain.com"
]
}
],
"terminal": true
},
3. The problem I’m having:
I use caddy2 as a reverse proxy to various services including my nextcloud container. My nextcloud instance is giving warnings about caldav and carddav. For some reason I was never able to setup caddy2 as a reverse proxy using a Caddyfile. I am able to do that with the JSON config that I have. I would like to know how to add the correct entries in the caddy2 reverse proxy json config file.
4. Error messages and/or full log output:
none
5. What I already tried:
I found that using the regular Caddyfile, we can do
redir /.well-known/carddav /remote.php/dav 301
redir /.well-known/caldav /remote.php/dav 301
but how would we do this in the json config