Matthew's Website

Fixing Caddy HTTP 403 Forbidden error


I wanted to improve my website's (not this one) performance by using images in AVIF and JPEGXL format, but I kept getting 403 Forbidden when trying to access them. I thought there was some kind of bug regarding Caddy's file_server. Turns out I was wrong.

Somehow the permissions on the .avif and .jxl files got changed and Caddy was literally forbidden from accessing them.

The fix? Just give Caddy the appropriate permissions:
chown -R caddy:caddy path-to-your-files