1. Caddy version (caddy version
):
2.2.1-r1 (devel)
2. How I run Caddy:
a. System environment:
Alpine Linux 3.12
Kernel 5.4.72-0-virt
OpenRC
b. Command:
This comes from my /etc/conf.d/caddy
caddy_opts="--config /etc/caddy/Caddyfile --adapter caddyfile"
c. Service/unit/compose file:
/etc/init.d/caddy
#!/sbin/openrc-run
supervisor=supervise-daemon
name="Caddy web server"
description="Fast, multi-platform web server with automatic HTTPS"
description_checkconfig="Check configuration"
description_reload="Reload configuration without downtime"
command=/usr/sbin/caddy
command_args="run $caddy_opts"
command_user=caddy:caddy
extra_commands="checkconfig"
extra_started_commands="reload"
depend() {
need net localmount
after firewall
}
checkconfig() {
ebegin "Checking configuration for $name"
su ${command_user%:*} -s /bin/sh -c "$command validate $caddy_opts"
eend $?
}
reload() {
ebegin "Reloading $name"
su ${command_user%:*} -s /bin/sh -c "$command reload $caddy_opts"
eend $?
}
stop_pre() {
if [ "$RC_CMD" = restart ]; then
checkconfig || return $?
fi
}
d. My complete Caddyfile or JSON config:
# Caddy's configuration file
# see: https://caddyserver.com/docs/caddyfile
localhost, 127.0.0.1, httpd1.local, 192.168.0.240 {
root * /var/www
}
3. The problem I’m having:
When accessing the site served by Caddy it differs from the one displayed when open from a hardrive.
Side by side comparison below.
4. Error messages and/or full log output:
No error messages. Here’s the output after
* Checking configuration for Caddy web server ...2020/11/16 18:29:41.794 INFO using provided configuration {"config_file": "/etc/caddy/Caddyfile", "config_adapter": "caddyfile"}
2020/11/16 18:29:41.795 INFO http 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}
2020/11/16 18:29:41.795 INFO http enabling automatic HTTP->HTTPS redirects {"server_name": "srv0"}
2020/11/16 18:29:41.810 INFO tls setting internal issuer for automation policy that has only internal subjects but no issuer configured{"subjects": ["localhost", "127.0.0.1", "httpd1.local", "192.168.0.240"]}
2020/11/16 18:29:41.811 INFO tls.cache.maintenance started background certificate maintenance {"cache": "0xc0002563f0"}
2020/11/16 18:29:41.811 INFO tls.cache.maintenance stopped background certificate maintenance {"cache": "0xc0002563f0"}
Valid configuration
[ ok ]
* Stopping Caddy web server ... [ ok ]
* Starting Caddy web server ... [ ok ]
5. What I already tried:
Tried adding
file_server
to the Caddyfile
6. Links to relevant resources:
Website isn’t the main purpose here, so I created it using Canva.
Link here