I’m trying to figure out a way to rewrite the uri so cady can search for the image that exists in my filesystem but doesn’t include the ?itok=L_byRGxn part.
4. Error messages and/or full log output:
No errors
5. What I already tried:
I tried the uri replace \?itok=(.*)$ "" described in my Caddyfile without success.
The file_server directive doesn’t take into account the query part of the URL when looking on disk, it only looks at the path. It would surprise me if your uri replace line does anything.
Also, the order in which directives are in a site block in the Caddyfile does not matter because they are sorted based on the preset directive order (except if you use a route block):
Thanks for your help. It seems the path to go is just to remove the ?itok=21j2k1 tokens from the filesystem and Caddy will take care of the files without issues.