1. Caddy version (caddy version
):
v2.1.1 h1:X9k1+ehZPYYrSqBvf/ocUgdLSRIuiNiMo7CvyGUQKeA=
2. How I run Caddy:
a. System environment:
Raspberry Pi OS 05-27-2020 (previously called Raspbian) based on Debian 10 (Buster). I am running it on a Raspberry Pi. I followed the installation procedure on Caddy’s wesbsite.
I am not running on docker. I assume it is systemd
given I used caddy.service
inside /etc/systemd/system
and use systemctl
command.
b. Command:
sudo systemctl start caddy
c. Service/unit/compose file:
# caddy.service
#
# For using Caddy with a config file.
#
# Make sure the ExecStart and ExecReload commands are correct
# for your installation.
#
# See https://caddyserver.com/docs/install for instructions.
#
# WARNING: This service does not use the --resume flag, so if you
# use the API to make changes, they will be overwritten by the
# Caddyfile next time the service is restarted. If you intend to
# use Caddy's API to configure it, add the --resume flag to the
# `caddy run` command or use the caddy-api.service file instead.
[Unit]
Description=Caddy
Documentation=https://caddyserver.com/docs/
After=network.target
[Service]
User=caddy
Group=caddy
ExecStart=/usr/local/bin/caddy run --environ --config /etc/caddy/Caddyfile
ExecReload=/usr/local/bin/caddy reload --config /etc/caddy/Caddyfile
TimeoutStopSec=5s
LimitNOFILE=1048576
LimitNPROC=512
PrivateTmp=true
ProtectSystem=full
AmbientCapabilities=CAP_NET_BIND_SERVICE
[Install]
WantedBy=multi-user.target
d. My complete Caddyfile or JSON config:
:80 {
root /main/* /var/www/
file_server
}
3. The problem I’m having:
under /var/www
I have a test HTML file. However, when I try to hit my IP from another computer on the same network with this: <Raspberry_Pi_IP_Address>/main
it does not work. However, when I had my config file as follows below:
:80 {
root * /var/www/
file_server
}
and in my browser I go to just the IP address http://<Raspberry_Pi_IP_Address>
, it works correctly and the HTML file loads.
4. Error messages and/or full log output:
no particular error message. It just does not load
5. What I already tried:
I have tried different configurations for the Caddyfile. I mentioned using just root *
above, but I also tried the following:
:80 {
root /main /var/www/
file_server
}
and
<IP_ADDRESS>/main:80 {
root * /var/www/
file_server
}
and other combinations
6. Links to relevant resources:
Please help me! thanks to all in advance!