1. The problem I’m having:
I’m currenlty using a single Caddy instance (one server) to serve as public proxy to my internal services. I would like to put 2 Caddy instances into production by sharing the same storage (redis).
Something like:
storage redis {
host {$CADDY_CLUSTERING_REDIS_HOST}
tls_enabled {$CADDY_CLUSTERING_REDIS_TLS}
}
But i have concerns of how to do it correctly, as for now, everything is stored (by default) locally.
By moving the storage to Redis on production server (basically, inserting the above code snippet) will everything be moved to that storage by Caddy? Should I do it manually (is there any docs)?
2. Error messages and/or full log output:
Not related.
3. Caddy version:
v2.7.6
4. How I installed and ran Caddy:
a. System environment:
Installe from distribution repos, Ubuntu 22.04 LTS x64
b. Command:
Run by systemd
c. Service/unit/compose file:
d. My complete Caddy config:
# GLOBAL options
{
servers {
strict_sni_host on
}
on_demand_tls {
ask http://ask.localhost/check
}
}
# Define LOGS block
(logs) {
log {
output file /var/log/caddy/{args[0]}.log
level ERROR
}
}
# Common server parameters
(serveroptions) {
header -Server
tls {
resolvers 1.1.1.2 1.0.0.2
on_demand
}
}
# Common options applied to upstream servers
(proxyoptions) {
transport http {
keepalive off
proxy_protocol v2
}
}
# auto_https "ASK" Server
import Allowedsites
# Server 1
server1.example.com {
import serveroptions
import logs server1.example.com
reverse_proxy {
to 192.168.1.6:4443
import proxyoptions
}
}
# Server 2
server2.example.com {
import serveroptions
import logs server2.example.com
reverse_proxy {
to 192.168.1.8:4443
import proxyoptions
}
}