1. Output of caddy version
:
v2.6.2
2. How I run Caddy:
local network with ip addresses
192.168.2.235:80 ← kiwix http
a. System environment:
lxc in proxmox, ubuntu 20.04
would love to use docker… but unsure how, i always get an error host is already in use…
b. Command:
sudo caddy run --config /opt/caddy/Caddyfile
c. Service/unit/compose file:
Docker:
version: "3.7"
services:
caddy:
image: caddy
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- /opt/containers/caddy/Caddyfile:/etc/caddy/Caddyfile
- caddy_data:/data
- caddy_config:/config
volumes:
caddy_data:
caddy_config:
d. My complete Caddy config:
https://192.168.2.235:10001 {
reverse_proxy http://192.168.2.235:80
}
3. The problem I’m having:
Hello, i am trying to use caddy to get an ip address within my network to work with ssl. Background: I am using kiwix for offline webpages, however some need an https handler. kiwix itsself is hosted via an lxc container in a docker environment and responds to a local ip address. i cannot use caddy in the same lxc container as port 80 is used by kiwix (and i cannot change it). The idea was to use a second container and run caddy in there. With docker i get an error that the host is already in use.
4. Error messages and/or full log output:
Deployment error
Deployment error
failed to deploy a stack: Removing caddy_caddy_1 Recreating 72a93f5eeec8_caddy_caddy_1 ... Host is already in use by another container e[1Ae[2K Recreating 72a93f5eeec8_caddy_caddy_1 ... e[31merrore[0m e[1B ERROR: for 72a93f5eeec8_caddy_caddy_1 Cannot start service caddy: driver failed programming external connectivity on endpoint caddy_caddy_1 (7be09319dc83077f595399ee975bdf06424dc3072587b64c4419d8e64c82d9f6): Error starting userland proxy: listen tcp4 0.0.0.0:80: bind: address already in use ERROR: for caddy Cannot start service caddy: driver failed programming external connectivity on endpoint caddy_caddy_1 (7be09319dc83077f595399ee975bdf06424dc3072587b64c4419d8e64c82d9f6): Error starting userland proxy: listen tcp4 0.0.0.0:80: bind: address already in use Encountered errors while bringing up the project. : exit status 1
5. What I already tried:
tried to go without docker:
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https | |
---|---|
curl -1sLf ‘https://dl.cloudsmith.io/public/caddy/stable/gpg.key’ | |
curl -1sLf ‘https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt’ | |
sudo apt update | |
sudo apt install caddy | |
sudo apt install libnss3-tools |
2. Caddyfile:
https://192.168.2.235:10001 {
reverse_proxy http://192.168.2.235:80
}
3. Root.crt to client
a. Sudo su
b. cd /root/.local/share/caddy/pki/authorities/local/root.crt
4. sudo caddy run --config /opt/caddy/Caddyfile
problem here: it wants me to run caddy fmt, but when i do nothing happens.