replace-response
replace-response copied to clipboard
Environment Variables - Incorrect Replacements
Hi,
I use caddy 2.6.2 with replace-response and noticed some weird replacements. I want to add a webroot/subdirectory to absolute paths which are stored in environment variables DOMAIN=mydomain.com and WEBROOT=/app.
replace https://{$DOMAIN} https://{$DOMAIN}{$WEBROOT} updated response from https://mydomain.com/script.js to https:///appmydomain.com/script.js (incorrect order within environment variable values).
After that I tried replace https://{$DOMAIN} https://before{$DOMAIN}after which results in https://beforeaftermydomain.com/script.js (environment variable values are always suffixed).
I expected https://mydomain.com/app/script.js. The hardcoded workaround replace https://mydomain.com https://mydomain.com/app works as expected.
Greets, ManOki
That's odd. What is the output of caddy adapt on your config?