1. Caddy version (caddy version
):
latest stable
2. How I run Caddy:
caddy.service
Caddyfile
a. System environment:
systemd Ubuntu 20.04
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 /etc/caddy/Caddyfile
ExecReload=/usr/bin/caddy reload --config /etc/caddy/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:
requests.movies4you.stream {
encode gzip
log {
output file /var/log/ombi_access.log {
roll_size 50mb
roll_keep 5
roll_keep_for 720h
}
}
reverse_proxy 127.0.0.1:5000
tls {
dns cloudflare API-KEY-HERE
}
}
accounts.movies4you.stream {
encode gzip
log {
output file /var/log/accounts_access.log {
roll_size 50mb
roll_keep 5
roll_keep_for 720h
}
}
reverse_proxy 127.0.0.1:8056
tls {
dns cloudflare API-KEY-HERE
}
}
stream.movies4you.stream {
encode gzip
log {
output file /var/log/jf_access.log {
roll_size 50mb
roll_keep 5
roll_keep_for 720h
}
}
reverse_proxy 127.0.0.1:8096
tls {
dns cloudflare API-KEY-HERE
}
}
3. The problem Iâm having:
I am having issues understanding how to setup Caddy2 with Nextcloud using the Caddyfile setup with Cloudflare. I already have Jellyfin, Ombi, and JFA-Go running through cloudflare and Caddy. I want to run my snap install of nextcloud through Caddy and Cloudflare. I have already basically done the legwork but i am having a hard time finding resources to explain what needs to be exactly edited to allow the snap nextcloud to run through caddy.
I have already run these commands.
sudo ufw allow 444/tcp
sudo ufw allow 81/tcp
I have already allowed 443 and 80 through for other programs currently being reverse proxied by caddy ie Jellyfin, Ombi
sudo ufw allow 443/tcp
sudo ufw allow 80/tcp
I had to allow port 444 HTTPS and 81 HTTP to be read by nextcloud
sudo snap set nextcloud ports.http=81 ports.https=444
Then i pasted in my domain ie photos.domain.com with this example
sudo nextcloud.occ config:system:set overwritehost --value="photos.techjunkiehosting.com:81"
next removed the memory limit (This is 100% Optional)
sudo snap set nextcloud php.memory-limit=-1
I have also found these resources below this line. I dont understand what exactly needs to be added to my caddyfile.
so far this is what i have made for the nextcloud caddyfile but have not implemented yet
photos.techjunkiehosting.com {
encode gziplog {
log {
output file /var/log/nextcloud.log {
roll_size 50mb
roll_keep 5
roll_keep_for 720h
}
}
reverse_proxy 127.0.0.1:81
tls {
dns cloudflare API-KEY-HERE
}
}
I have also setup the domain to fully work with cloudflare and caddy. Basically I just need help setting up the caddyfile to get it working.
Could anyone give in detail what i have to do to get the snap install of nextcloud succesfully setup with caddy and cloudflare.
Thank you ahead of time.