1. Caddy version (caddy version
):
v2.2.1 h1:Q62GWHMtztnvyRU+KPOpw6fNfeCD3SkwH7SfT1Tgt2c=
2. How I run Caddy:
a. System environment:
Linux (Ubuntu 18.04) amd64, manual run.
b. Command:
sudo -E caddy start --config /etc/caddy/Caddyfile
sudo -E pulls in my api key for cloudflare.
d. My complete Caddyfile or JSON config:
aftermath.space {
encode gzip
tls {
dns cloudflare {env.CLOUDFLARE_AUTH_TOKEN}
}
root * /var/www/landing
file_server
}
forums.aftermath.space {
tls {
dns cloudflare {env.CLOUDFLARE_AUTH_TOKEN}
}
root * /var/www/afterlife
encode gzip zstd
try_files {path} {path}/ /index.html
file_server
}
3. The problem I’m having:
I am running a react app where the folder inside of forums.aftermath.space
(root dir). Trying to load up the url gives me errors, as some of the files within the html file are being interpreted as html instead of JS/CSS. Upon closer inspection, it seems that some files within the static/css directory are not being found by Caddy and instead the default index.html file is being returned. I tried putting in the url manually, and this confirmed that theory, as some urls in the html file would return the normal js / css content, while others would return the index page. I tried opening them up manually within the terminal, and the files are correct on the outside, so it must be something messing up somewhere.
Does anyone have any idea what’s going on with this? It makes little sense to me. I tried with multiple browsers and PCs, the same issue occurred.
4. Error messages and/or full log output:
N/A
5. What I already tried:
I’ve loaded pretty much every Caddyfile template I could find and have had no success getting stuff to load properly.