1. The problem I’m having:
I’m trying to use the file_server
directive, but it’s not going well at all.
Here’s my Caddyfile
127.0.0.1
root * /static/
file_server
My folder structure looks like this:
Caddyfile
static/
- index.html
assets/
css/
- style.css
2. Error messages and/or full log output:
It starts the file server, but when I go to localhost:2019
it just shows me 404 Not Found
. The request is being shown in the Caddy console. Changing this to localhost:2019/index.html
also doesn’t change anything.
2023/07/03 21:52:37.212 INFO admin.api received request {"method": "GET", "host": "localhost:2019", "uri": "/", "remote_ip": "127.0.0.1", "remote_port": "57197", "headers": {"Accept":["text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8"],"Accept-Encoding":["gzip, deflate, br"],"Accept-Language":["en-US,en;q=0.5"],"Connection":["keep-alive"],"Sec-Fetch-Dest":["document"],"Sec-Fetch-Mode":["navigate"],"Sec-Fetch-Site":["none"],"Sec-Fetch-User":["?1"],"Upgrade-Insecure-Requests":["1"],"User-Agent":["Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/114.0"]}}
3. Caddy version:
2.6.4
4. How I ran Caddy:
caddy run
from the actual root folder. Parent of static/
System:
Windows 10 19045