Blank display after installation

1. Caddy version (2.2.1):

2. How I run Caddy:

Digital Ocean marketplace

a. System environment:

1 GB Memory / 25 GB Disk / AMS3 - on Ubuntu 18.04

b. Command:

sudo systemctl reload caddy

c. Service/unit/compose file:

Rather folder- and filenames

$ cd /var/www/
$ alternativephotography.eu  issue.log

d. My complete Caddyfile or JSON config:

alternativephotography.eu, www.alternativephotography.eu {
    root *  /var/www/alternativephotography.eu
    file_server
    log {
        output file /var/www/issue.log
    }
}

3. The problem I’m having:

I’m unable to see my website. No matter what I tried, the page stays blank. Even a simple index.html file with nothing more than Hello World will not load. The browser reports a 200 but the logs show a 404.

4. Error messages and/or full log output:

{“level”:“error”,“ts”:1639737232.8647988,“logger”:“http.log.access.log0”,“msg”:“handled request”,“request”:{“remote_addr”:“178.119.9.45:44150”,“proto”:“HTTP/2.0”,“method”:“GET”,“host”:“alternativephotography.eu”,“uri”:"/",“headers”:{“User-Agent”:[“Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.1 Safari/605.1.15”],“Accept”:[“text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8”],“Accept-Language”:[“en-gb”],“Accept-Encoding”:[“gzip, deflate, br”]},“tls”:{“resumed”:false,“version”:772,“cipher_suite”:4865,“proto”:“h2”,“proto_mutual”:true,“server_name”:“alternativephotography.eu”}},“common_log”:“178.119.9.45 - - [17/Dec/2021:10:33:52 +0000] “GET / HTTP/2.0” 404 0”,“duration”:0.000146963,“size”:0,“status”:404,“resp_headers”:{“Server”:[“Caddy”]}}

5. What I already tried:

I tried changing the location of my files;
used root index.html instead of root *;
used file_server browse;
respond shows the correct text;
tried setting up as a single domain (without the { });
chmod permissions to -R 644 of the folder.

6. Links to relevant resources:

https://alternativephotography.eu

The browser shows 404 for me. Must be something about your cache, DNS, or something else about your system/network.

404 for a request to a directory is usually because the folder doesn’t exist, or it doesn’t contain an index file. So check on those things.

That’s a pretty old version of Caddy. Please upgrade! The latest is v2.4.6.

The DO image should be configured to update Caddy by running sudo apt update && sudo apt upgrade.

Make sure the caddy user has permission to read that directory. The systemd service runs Caddy using that user.

1 Like

The issue was indeed with the permissions. Once set to 777 I found no issues. I changed the owner of the files and reversed it to 555 solving all issues!

2 Likes

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