Hi @balki, welcome to the Caddy community.
When you configure a site with the address
example.com/foo, that site only works on requests to
example.com/foo (and its subfolders, such as
example.com/foo/bar). That means Caddy doesn’t use this site configuration to serve requests for
example.com or any subfolders other than
So, when you make requests to these non-
/foo subfolders, Caddy responds as though you aren’t serving that site at all (status 421).
In order to handle requests for
example.com or other subfolders, you need to tell Caddy how to handle them by adding new site blocks and configuration for them, e.g.:
# This part serves /foo
proxy / [...]
# This part serves /bar
# This part serves any request other than /foo or /bar