Local page serving directory invalid

1. Caddy version (caddy version):


2. How I run Caddy:

caddy start

a. System environment:

Ubuntu 20.4 on DigitalOcean droplet

b. Command:

caddy file command file_server

c. Service/unit/compose file:

d. My complete Caddyfile or JSON config:

```        root * /var/www/public_html
```        }

### 3. The problem I'm having:
Trying to display a static page (Trying to get the simple things right before trying redirects).

caddy validate generates the error:
root@viewfromafar:/etc/caddy# caddy validate
2022/04/14 03:58:16.845 INFO    using adjacent Caddyfile
validate: adapting config using caddyfile: parsing caddyfile tokens for 'file_server': Caddyfile:2 - Error during parsing: unknown subdirective '/var/www/public_html'
root@viewfromafar:/etc/caddy# cd /var/www/public_html

Yet the path exists from the top level:
root@viewfromafar:/var/www/public_html# ls

Neither does: 
```        root * ../var/www/public_html

work. That is the location from /etc/caddy where Caddyfile is located and from where caddy is executed.

Hmm, the formatting of your post is all messed up, I’m not sure I understand what’s being asked. Could you please try to fix it up?

For code blocks, the backticks ` should be on their own lines, before and after the code/logs (not at the start of the lines).

1 Like

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