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.
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
andWEBROOT=/app
.replace https://{$DOMAIN} https://{$DOMAIN}{$WEBROOT}
updated response fromhttps://mydomain.com/script.js
tohttps:///appmydomain.com/script.js
(incorrect order within environment variable values).After that I tried
replace https://{$DOMAIN} https://before{$DOMAIN}after
which results inhttps://beforeaftermydomain.com/script.js
(environment variable values are always suffixed).I expected
https://mydomain.com/app/script.js
. The hardcoded workaroundreplace https://mydomain.com https://mydomain.com/app
works as expected.Greets, ManOki