Caddy returns blank page always

1. Caddy version (caddy version):


2. How I run Caddy:

Under termux, android 11, lineageos. Caddy from official termux repos

a. System environment:


b. Command:

caddy run --config Caddyfile

c. Service/unit/compose file:


d. My complete Caddyfile or JSON config:

http://localhost:8080 {
	root * /data/data/com.termux/files/home
	file_server browse

3. The problem I’m having:

Cant view any files, even index.html, all reuquest return a blank oage

4. Error messages and/or full log output:


2021/10/24 08:00:58.684 INFO    using provided configuration    {"config_file": "Caddyfile", "config_adapter": ""}
2021/10/24 08:00:58.700 INFO    admin   admin endpoint started  {"address": "tcp/localhost:2019", "enforce_origin": false, "origins": ["localhost:2019", "[::1]:2019", ""]}
2021/10/24 08:00:58.705 INFO    tls.cache.maintenance   started background certificate maintenance        {"cache": "0x4000628000"}
2021/10/24 08:00:58.707 INFO    tls     cleaning storage unit   {"description": "FileStorage:/data/data/com.termux/files/home/caddy"}
2021/10/24 08:00:58.708 INFO    tls     finished cleaning storage units
2021/10/24 08:00:58.714 INFO    autosaved config (load with --resume flag){"file": "/data/data/com.termux/files/home/.config/caddy/autosave.json"}
2021/10/24 08:00:58.714 INFO    serving initial configuration

Curl output:

~ $ curl -v
*   Trying
* Connected to ( port 8080 (#0)
> GET / HTTP/1.1
> Host:
> User-Agent: curl/7.79.1
> Accept: */*
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Server: Caddy
< Date: Sun, 24 Oct 2021 08:08:11 GMT
< Content-Length: 0
* Connection #0 to host left intact

5. What I already tried:

Adding file_server to Caddyfile, since apparently not adding that causes blank pages, but it happens for me rrgardless.
I also tried this on desktop ubuntu, and the problem exists(with the same config)

6. Links to relevant resources:

You used localhost as your site address, so Caddy is waiting for requests for the hostname localhost to serve the content, as configured. But you requested, which is not localhost (resolves to the same IP, but many domains can resolve to the same IP address).

Either use :8080 as your site address to accept HTTP requests for any hostname, or make your request with curl -v localhost:8080 instead.

The result of a blank page is Caddy’s default behaviour for the request not having been handled by any request handlers. Technically the site address is a host matcher, so if it doesn’t match, it fall through unhandled and you end up with an empty response. Caddy essentially worked as configured.


This topic was automatically closed after 30 days. New replies are no longer allowed.