Fileserver root path

I would like to serve files from a directory. I have configured the following:

my.url {
  root * /somedir
  fileserver browse

This works but the path is http://my.url/somedir/file.gz, I would like to server http://my.url/file.gz

Could anyone please point me to the right way to do this? Thanks

What are the contents of /somedir?

(Please follow the Help template that you deleted, it’s necessary to give you the help you request.)

Just a bunch of gzipped file archives

Hm, your config works as expected for me.

Please fill out the help template completely with enough information to reproduce the behavior you’re seeing, we’ll need to know the exact steps you took.

My bad on not doing this first, I thought it was just some stupid config error on my part. In the process of going through the debug steps I solved my own problem. The script that was syncing the folder was creating an extra nested folder. Caddy is working as expected and was not involved. Sorry for any time wasted. Lesson learned. On the bright side I have a better understanding of how to debug caddy :slight_smile:


Excellent – that’s the best way to learn!! Thanks for sharing.

1 Like

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