1. The problem I’m having:
I would like to express my sincere gratitude to the community for the invaluable support provided throughout my journey.
Currently, I am facing an issue with slow transfer speeds on my Caddy and Nextcloud setup. To provide some context, I am running two Ubuntu cloud-init VMs on Proxmox, each residing in separate VLANs and equipped with Docker. One VM hosts a Caddy container, with the QUIC protocol configured, while the other hosts a Nextcloud container. I have them in separate VMs incase i have to restore my Nextcloud all of my site redirects/services will still work while im fixing my Nextclod
Interestingly, individual speed tests conducted on both VMs demonstrate the full utilization of the 1 Gig bandwidth. Moreover, remote clients, equipped with a 1 Gig internet connection, report similar speed test results to mine.
However, during actual transfers to clients, the speed does not exceed 120 Mbps.
It’s worth noting that I utilize Cloudflare for DNS management, operating in DNS mode only without proxying for my domains.
Regarding firewall configurations, there are no speed or bandwidth restrictions imposed on the Nextcloud and Caddy VMs. Specifically, the firewall settings allow the Nextcloud VM to communicate with the Caddy VM over ports 443 and 80, and the Caddy VM can communicate with Nextcloud on all ports.
I would appreciate insights on whether any unnecessary configurations exist in my Caddyfile or Nextcloud setup, and if there are recommendations for optimizing the container setup or composing a more efficient configuration.
2. Caddy version: v2.7.6
3. How I installed and ran Caddy: Docker
a. System environment:
VM in serprate vlan on Pro
b. My complete Caddy config:
test.example.com, test2.example.com, test1.example.com {
reverse_proxy 192.168.1.16:8443
root * /var/www/html
file_server
encode zstd gzip
redir /.well-known/carddav /remote.php/dav/ 301
redir /.well-known/caldav /remote.php/dav/ 301
redir /.well-known/webfinger /index.php/.well-known/webfinger 301
redir /.well-known/nodeinfo /index.php/.well-known/nodeinfo 301
header {
# disable FLoC tracking
Permissions-Policy interest-cohort=()
# enable HSTS
Strict-Transport-Security max-age=31536000;
# keep referrer data off of HTTP connections
Referrer-Policy no-referrer-when-downgrade
}
# .htaccess / data / config / ... shouldn't be accessible from outside
@forbidden {
path /.htaccess
path /data/*
path /config/*
path /db_structure
path /.xml
path /README
path /3rdparty/*
path /lib/*
path /templates/*
path /occ
path /console.php
}
handle @forbidden {
respond 404
}
}
c. Caddy Docker compose file:
version: "3.8"
services:
caddy:
image: caddy:latest
container_name: caddy
restart: unless-stopped
ports:
- 80:80
- 443:443
- 443:443/udp
volumes:
- /home/ubuntu/docker/caddy/Caddyfile:/etc/caddy/Caddyfile
- /home/ubuntu/docker/caddy/site:/srv
- /home/ubuntu/docker/caddy/caddy_data:/data
- /home/ubuntu/docker/caddy/caddy_config:/config
labels:
- com.centurylinklabs.watchtower.monitor-only=true
network_mode: host
d. My Nextcloud Docker Compose:
version: '3'
services:
db:
image: mariadb:11.3.2
container_name: nc_db
restart: unless-stopped
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW --innodb-file-per-table=1 --innodb-read-only-compressed=OFF
volumes:
- /home/nc/docker/nextcloud/nextca/db:/var/lib/mysql
ports:
- 3306:3306
environment:
- MYSQL_ROOT_PASSWORD=password
- MYSQL_PASSWORD=password
- MYSQL_DATABASE=db
- MYSQL_USER=nc
labels:
- com.centurylinklabs.watchtower.monitor-only=true
networks:
- dmz_net
redis:
image: redis:7.2.4
container_name: nc_redis
restart: unless-stopped
command: redis-server --requirepass password
# ports:
# - 6378:6378
labels:
- com.centurylinklabs.watchtower.monitor-only=true
networks:
- dmz_net
app:
image: nextcloud:28.0.4
container_name: nc
restart: unless-stopped
ports:
- 8443:80
links:
- db
- redis
volumes:
- /home/nc/docker/nextcloud/nextca/data:/var/www/html
- /home/nc/cloud:/ext_next
- /home/nc/docker/nextcloud/nextca/nextcloud-apache.conf:/etc/apache2/conf-enabled/nextcloud-apache.conf:ro
environment:
- MYSQL_PASSWORD=password
- MYSQL_DATABASE=db
- MYSQL_USER=nc
- MYSQL_HOST=nc_db
- REDIS_HOST=nc_redis
- REDIS_HOST_PASSWORD=password
- NEXTCLOUD_INIT_HTACCESS=true
- TZ=America/NewYork
labels:
- com.centurylinklabs.watchtower.monitor-only=true
extra_hosts:
- test.example.com:192.168.60.60 #host and ip
depends_on:
- db
- redis
networks:
- dmz_net
networks:
dmz_net:
external: true