Closed syxolk closed 1 year ago
I've tried replace /index.html __BASE_URL__ https://example.com
and it seems to work. At least, I don't get any warnings or errors. Is this actually a supported syntax?
I'm not sure I understand what you mean by a patch matcher
?
Sorry, I meant "path matcher" of course. This: https://caddyserver.com/docs/caddyfile/matchers#path-matchers
I fixed the title.
Ah, ok -- I wasn't sure, since PATCH is also an HTTP method, and could theoretically be related to matchers.
Is there a way to make sure that the replace directive is only run for my index.html file, e.g. with path matchers?
I would do:
replace /index.html __BASE_URL__ https://example.com
Or if the request is for /
instead:
replace / __BASE_URL__ https://example.com
Let's say I've got an
index.html
and serveral static JS+CSS files that are served via Caddy'sfile_server
directive. Is there a way to make sure that thereplace
directive is only run for myindex.html
file, e.g. with path matchers? I didn't see any example or documentation about that in this repository.Just for the record: these are my files
My
index.html
looks like this:And my Caddyfile looks like this: