1. The problem I’m having:
I try to use the file_server with the latest caddy version. When I run caddy and make a call via curl or Chrome is the response an empty page. I’m pretty sure that I miss something important therefore I seek here for help and the eyeopener , thank you for your help.
2. Error messages and/or full log output:
alex@alex-TUXEDO-Book-XP1511 on Di Mai 09 at 21:58:35 /datadisk/git-repos/caddyv2-upload/docker-files/opt/webroot # APPPORT=8888 ~/Downloads/caddy_linux_amd64 run --config config/Caddyfile-test
2023/05/09 19:58:36.166 INFO using provided configuration {"config_file": "config/Caddyfile-test", "config_adapter": ""}
2023/05/09 19:58:36.167 WARN admin admin endpoint disabled
2023/05/09 19:58:36.168 WARN http automatic HTTPS is completely disabled for server {"server_name": "srv0"}
2023/05/09 19:58:36.168 INFO tls.cache.maintenance started background certificate maintenance {"cache": "0xc0005482a0"}
2023/05/09 19:58:36.168 INFO tls cleaning storage unit {"description": "FileStorage:/home/alex/.local/share/caddy"}
2023/05/09 19:58:36.168 INFO tls finished cleaning storage units
2023/05/09 19:58:36.168 DEBUG http starting server loop {"address": "[::]:8888", "tls": false, "http3": false}
2023/05/09 19:58:36.168 INFO http.log server running {"name": "srv0", "protocols": ["h1", "h2", "h3"]}
2023/05/09 19:58:36.168 INFO autosaved config (load with --resume flag) {"file": "/home/alex/.config/caddy/autosave.json"}
2023/05/09 19:58:36.168 INFO serving initial configuration
# Request via Curl
2023/05/09 19:58:41.744 INFO http.log.access handled request {"request": {"remote_ip": "127.0.0.1", "remote_port": "37802", "proto": "HTTP/1.1", "method": "GET", "host": "127.0.0.1:8888", "uri": "/", "headers": {"User-Agent": ["curl/7.81.0"], "Accept": ["*/*"]}}, "user_id": "", "duration": 0.000002025, "size": 0, "status": 0, "resp_headers": {"Server": ["Caddy"]}}
Curl output
curl -v http://127.0.0.1:8888/
* Trying 127.0.0.1:8888...
* Connected to 127.0.0.1 (127.0.0.1) port 8888 (#0)
> GET / HTTP/1.1
> Host: 127.0.0.1:8888
> User-Agent: curl/7.81.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Server: Caddy
< Date: Tue, 09 May 2023 20:25:55 GMT
< Content-Length: 0
<
* Connection #0 to host 127.0.0.1 left intact
3. Caddy version:
~/Downloads/caddy_linux_amd64 version
v2.6.4 h1:2hwYqiRwk1tf3VruhMpLcYTg+11fCdr8S3jhNAdnPy8=
4. How I installed and ran Caddy:
Just downloaded via Download Caddy
a. System environment:
I start it via CLI run
b. Command:
APPPORT=8888 ~/Downloads/caddy_linux_amd64 run --config config/Caddyfile-test
c. Service/unit/compose file:
I start it via CLI run
d. My complete Caddy config:
{
http_port {$APPPORT}
https_port 0
auto_https off
admin off
log {
level DEBUG
}
}
localhost:{$APPPORT} {
root .
file_server browse
templates
log {
output file access.log
}
}
5. Links to relevant resources:
I’m debugging the issue in Response template doesn't get returned on successful upload · Issue #12 · git001/caddyv2-upload · GitHub in my module and was a little bit confused that the simple file_server does not show the browse page.