Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Environment Variables - Incorrect Replacements #17

Open
ManOki opened this issue Dec 31, 2022 · 1 comment
Open

Environment Variables - Incorrect Replacements #17

ManOki opened this issue Dec 31, 2022 · 1 comment
Labels
needs info More information is required

Comments

@ManOki
Copy link

ManOki commented Dec 31, 2022

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

@mholt
Copy link
Member

mholt commented Dec 31, 2022

That's odd. What is the output of caddy adapt on your config?

@mholt mholt added the needs info More information is required label Dec 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs info More information is required
Projects
None yet
Development

No branches or pull requests

2 participants