I installed Caddy 2.6.2 using apt-get, no plugins added. I added my static website to Caddyfile and it works great.
When I add another website using my local ip (192.168.0.40 {root… …} and run ‘sudo caddy reload’ it gives an error and I have no idea the problem is.
2. Error messages and/or full log output:
The error I get when running 'sudo caddy reload is
2024/01/01 14:31:31.671 INFO using adjacent Caddyfile
2024/01/01 14:31:31.676 WARN Caddyfile input is not formatted; run the 'caddy fmt' command to fix inconsistencies {"adapter": "caddyfile", "file": "Caddyfile", "line": 12}
What is on line 12 is “root * /var/www/domain.tld/public_html” for my working static website.
3. Caddy version:
Caddy 2.6.2
4. How I installed and ran Caddy:
I installed Caddy using apt-get on Debian Bookworm
a. System environment:
Raspberry Pi 4
Debian 12 Bookworm
systemd 252 (252.19-1~deb12u1)
b. Command:
Caddy runs using systemd.
The command I run to get the error is
# The Caddyfile is an easy way to configure your Caddy web server.
#
# Unless the file starts with a global options block, the first
# uncommented line is always the address of your site.
#
# To use your own domain name (with automatic HTTPS), first make
# sure your domain's A/AAAA DNS records are properly pointed to
# this machine's public IP, then replace ":80" below with your
# domain name.
t*****.dev, www.t****.dev {
root * /var/www/t*****.dev/public_html
#php_fastcgi unix//run/php/php7.4-fpm.sock
file_server
encode gzip
#@disallowed {
# path /xmlrpc.php
# path *.sql
# path /wp-content/uploads/*.php
#}
#rewrite @disallowed '/index.php'
}
192.168.102.5 {
root * /var/www/html/admin
php_fastcgi unix//run/php/php8.2-fpm.sock
file_server
encode gzip
#@disallowed {
# path /xmlrpc.php
# path *.sql
# path /wp-content/uploads/*.php
#}
#rewrite @disallowed '/index.php'
}
#:80 {
# # Set this path to your site's directory.
# root * /var/www/t****.dev/public_html/
#
# # Enable the static file server.
# file_server
#
# # Another common task is to set up a reverse proxy:
# # reverse_proxy localhost:8080
#
# # Or serve a PHP site through php-fpm:
# # php_fastcgi localhost:9000
#}
# Refer to the Caddy docs for more information:
# https://caddyserver.com/docs/caddyfile
I’m trying to add a (temporary) url (ip address) for the pi-hole admin webpage.