Hi
You seem to be missing a }
here:
header /static/* Cache-Control max-age=31536000
}
+ }
photos.natehn.com {
root * /home/nathan/photos/_build
You can validate your config via caddy validate
before applying
Please don’t use caddy start
but instead caddy run
. Or even better, the systemd service, which you seem to have since you shared some systemctl status caddy.service
output.
Please see Problem with with caddy - #2 by francislavoie
That isn’t actually a caddy error but instead systemd trying to tell you, that you are missing the necessary permissions and might need to use sudo
(sudo systemctl start caddy.service
) or user root
.
To actually view the full logs of caddy (when running as systemd service), you would use something like
journalctl --unit caddy.service --no-pager | less +G
(and press q
if you want to exit again).
Also, with both root * /home/nathan/blog/public
and /home/nathan/photos/_build
you might be running into file permission issues.
I am more or less in the process of doing a proper write-up about common file permission with caddy (or any webserver really) which would explain that in detail.
But in the meantime, you might want to read:
tldr is basically: Don’t use /home/
but instead /srv/
or /var/www/
.
Feel free to ask any additional questions, especially because if anything is unclear or if you encounter any issue