1. Caddy version (
2. How I run Caddy:
a. System environment:
Ubuntu 20.04, docker, docker-compose
docker-compose up -d
c. Service/unit/compose file:
d. My complete Caddyfile or JSON config:
root * /www
3. The problem I’m having:
I have the following files at
Also in subfolder
~/www/test.com I have a second
index.html and a
When I try
http://serveraddress I can see the file
index.html. If I remove this file, the
index.php is served ok.
But if I try
http://serveraddress/test.com I can see the “Test page” text but not the image.
If I try
http://serveraddress/test.com/ (with the slash) I can see both the text and image.
How can the trailing / can be added to the URL?
I know that the solution must be very simple but I am a newbie in caddy and still learning.
I think this should work if you just leave out that
php_fastcgi has its own
try_files built-in so it shouldn’t be necessary to add in your own. But if it doesn’t work, it might with a fix that was just merged on the master branch.
I added also a simple
index.php in subfolder as a test.
http://serveraddress/test.com without the
try_files. Now the
index.html is ignored and the
index.php from the subfolder is served instead.
If I delete
index.php from the subfolder, the
index.php from the root is served!
I don’t understand why you would have two index files in the same directory though. That’s ambiguous.
That said, I think this might be fixed by a commit that just landed in the master branch yesterday. Previously
try_files wasn’t properly handling the existence of directories, and therefore possibly index files in those directories.
I am just testing things. I am not going to let 2 index files on the same directory.
About the commit, is there any documentation on how to build the docker image with the latest code ?
Unfortunately it’s not quite so easy to build from source right now, but as soon as this is merged and deployed, it will be (hopefully today):
We’re updating the
builder image variant to use
xcaddy, which will let you specify an arbitrary target to build from instead of only tagged releases.
This topic was automatically closed after 30 days. New replies are no longer allowed.