Is it possible for caddy to block URLs containing certain words ? As these certain words change all the time, is it also possible to achieve this dynamicly, say reading a text file that the words are kept ?
Because otherwise i have to alter the Caddyfile and restart the caddy every time.
Simply if the URL contains a word from a local text file block it.
Trust me, it’s easier than you think. Give it a shot! The guide walks you through it quite well. You could probably do what you need in like ~100 lines of code or less.
That’s what i’m tryin to achieve but substrings in the url change all the time so the will-be-matched words too.
I can keep the words in a text file and alter it dynamicly when needed. That’s why i’m looking for a way to achieve it automaticly without altering the caddyfile and restart caddy every time.
FYI you should not “restart” Caddy when you change the config, you should “reload” it, which is a zero-downtime config change.
But still, writing a plugin is definitely the solution you need. Just try! Go is an easy language to learn, especially with VSCode Go extension linter and on-save auto-code-fixing.