How to enable autoindex for /abc path

I want to enable autoindex only for /abc path is this possible with caddy?

Please fill out the template. What does autoindex mean?

1 Like

Autoindex means file listing in caddy

Go through the documentation

1 Like

Use multiple file_server blocks, with the last one matching everything with browse (the Caddy equivelent of nginx autoindex) turned off

http://localhost:8000 {
    root /var/www
    file_server /abc/ browse
    file_server *
}
1 Like

not working, my current caddy config file

example.tld www.example.tld {
@www {
host www.example.tld
}

redir @www https://example.tld{uri} permanent

root * /www/example.tld
file_server /abc/ browse
file_server *
php_fastcgi unix//run/php-fpm/www.sock

header Strict-Transport-Security “max-age=31536000; includeSubDomains; preload”
header X-Content-Type-Options “nosniff”
header X-Frame-Options “SAMEORIGIN”
}

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