1. The problem I’m having:
Just pushing through the root location leaves me with a blank page.
2. Error messages and/or full log output:
https-proxy | {"level":"info","ts":1708295674.1942203,"msg":"using provided configuration","config_file":"/etc/caddy/Caddyfile","config_adapter":"caddyfile"}
https-proxy | {"level":"warn","ts":1708295674.1954103,"msg":"Caddyfile input is not formatted; run 'caddy fmt --overwrite' to fix inconsistencies","adapter":"caddyfile","file":"/etc/caddy/Caddyfile","line":2}
https-proxy | {"level":"info","ts":1708295674.1980996,"logger":"admin","msg":"admin endpoint started","address":"localhost:2019","enforce_origin":false,"origins":["//[::1]:2019","//127.0.0.1:2019","//localhost:2019"]}
https-proxy | {"level":"info","ts":1708295674.1982856,"logger":"http.auto_https","msg":"server is listening only on the HTTPS port but has no TLS connection policies; adding one to enable TLS","server_name":"srv0","https_port":443}
https-proxy | {"level":"info","ts":1708295674.1983066,"logger":"http.auto_https","msg":"enabling automatic HTTP->HTTPS redirects","server_name":"srv0"}
https-proxy | {"level":"info","ts":1708295674.2004554,"logger":"http","msg":"enabling HTTP/3 listener","addr":":443"}
https-proxy | {"level":"info","ts":1708295674.2028117,"msg":"failed to sufficiently increase receive buffer size (was: 208 kiB, wanted: 2048 kiB, got: 416 kiB). See https://github.com/quic-go/quic-go/wiki/UDP-Buffer-Sizes for details."}
https-proxy | {"level":"info","ts":1708295674.2033901,"logger":"http.log","msg":"server running","name":"srv0","protocols":["h1","h2","h3"]}
https-proxy | {"level":"info","ts":1708295674.2035475,"logger":"http.log","msg":"server running","name":"remaining_auto_https_redirects","protocols":["h1","h2","h3"]}
https-proxy | {"level":"info","ts":1708295674.203563,"logger":"http","msg":"enabling automatic TLS certificate management","domains":["DOMAIN"]}
https-proxy | {"level":"info","ts":1708295674.2086053,"logger":"tls.cache.maintenance","msg":"started background certificate maintenance","cache":"0xc000377600"}
https-proxy | {"level":"warn","ts":1708295674.2256005,"logger":"tls","msg":"storage cleaning happened too recently; skipping for now","storage":"FileStorage:/data/caddy","instance":"f2f8b102-998b-4a40-a0dc-d458df15f5ed","try_again":1708382074.2255976,"try_again_in":86399.999999219}
https-proxy | {"level":"info","ts":1708295674.2257626,"logger":"tls","msg":"finished cleaning storage units"}
https-proxy | {"level":"info","ts":1708295674.2258766,"msg":"autosaved config (load with --resume flag)","file":"/config/caddy/autosave.json"}
https-proxy | {"level":"info","ts":1708295674.2258875,"msg":"serving initial configuration"}
3. Caddy version:
latest docker container
4. How I installed and ran Caddy:
via docker compose and a Caddyfile
a. System environment:
Docker on Ubuntu 22.04 LTS
b. NGINX file I’m trying to replicate:
## Version 2019/08/01 - Changelog: https://github.com/linuxserver/docker-letsencrypt/commits/master/root/defaults/default
# redirect all traffic to https
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
return 301 https://$host$request_uri;
}
server {
server_name _;
listen 443 ssl http2;
listen [::]:443 ssl http2;
root /var/www/hudu2/public;
index index.html;
include /config/nginx/ssl.conf;
# deny requests for files that should never be accessed
location ~ /\. {
deny all;
}
location ~* ^.+\.(rb|log)$ {
deny all;
}
# send non-static file requests to the app server
location / {
try_files $uri @rails;
}
location @rails {
include /config/nginx/proxy.conf;
proxy_pass http://app:3000;
}
}
# enable subdomain method reverse proxy confs
include /config/nginx/proxy-confs/*.subdomain.conf;
# enable proxy cache for auth
proxy_cache_path cache/ keys_zone=auth_cache:10m;
c. Service/unit/compose file:
version: '3.9'
services:
https-proxy:
image: caddy:latest
container_name: https-proxy
restart: unless-stopped
volumes:
- /home/USER/hudu/Caddyfile:/etc/caddy/Caddyfile
- https_proxy:/data
ports:
- "80:80"
- "443:443"
volumes:
https_proxy:
d. My complete Caddy config:
https://DOMAIN {
root * /var/www/hudu2/public
}