I want to use basicauth only then requests are not originating in the local subnet. Therefor I tried to configure a matcher to achieve that.
Acording to this posting I think my syntax should be correct.
4. Error messages and/or full log output:
caddy run --config /etc/caddy/Caddyfile --adapter caddyfile
2020/03/11 16:40:32.877 INFO using provided configuration {"config_file": "/etc/caddy/Caddyfile", "config_adapter": "caddyfile"}
run: adapting config using caddyfile: /etc/caddy/Caddyfile:2: unrecognized directive: not
Your Caddyfile has a few syntax issues. Primarily, matcher blocks must appear within a site block, and you need to reference the matcher on the directives you wish to apply them to.
I think this is closer to what you’re looking to do:
Thank you for your hints. I had the impression I could define the matcher outside of a site block and reuse it for multiple sites. My intended use of the matcher is for a basicauth directive which I will try next.