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

Host variable not replaced on certain requests #52

Open
simonjenny opened this issue Feb 1, 2022 · 5 comments · May be fixed by #68 or #72
Open

Host variable not replaced on certain requests #52

simonjenny opened this issue Feb 1, 2022 · 5 comments · May be fixed by #68 or #72

Comments

@simonjenny
Copy link

Certain requests sent from a Browser are not correctly resolved:

Feb 01 11:03:50 wraxx-html-0001 bash[9696]: {"level":"debug","ts":1643709830.4053314,"logger":"http.handlers.s3proxy","msg":"get from S3","bucket":"wraxx","key":"/dash.simonjenny.dev/index.html"}
Feb 01 11:00:47 wraxx-html-0001 bash[9696]: {"level":"debug","ts":1643709647.560506,"logger":"http.handlers.s3proxy","msg":"get from S3","bucket":"wraxx","key":"/{http.request.host}/index.html"}

I already ask in the Caddy Community and it was suggested, that the proxy does not replace the {http.request.host} variable on every request: https://caddy.community/t/how-can-i-handle-empty-host-variables/14936

This is my s3proxy configuration:

s3proxy {
     bucket {$SITES}
     region {$AWS_REGION}
     endpoint {$AWS_HOST}
     index  index.html
     root   /{host}
     errors /{host}/index.html
}

xcaddy build command:

xcaddy build \
    --with github.com/ss098/certmagic-s3 \
    --with github.com/lindenlab/caddy-s3-proxy
@simonjenny
Copy link
Author

simonjenny commented Feb 1, 2022

Alright, after some more digging I found out that {http.request.host} variables are not replaced in errors.

@rayjlinden
Copy link
Contributor

So this is just caddy behavior right? Not a bug in this plugin?

perebusquets added a commit to perebusquets/caddy-s3-proxy that referenced this issue Jan 14, 2024
@perebusquets perebusquets linked a pull request Jan 14, 2024 that will close this issue
@perebusquets
Copy link

Hi, I created a PR aiming to fix this issue, could you please take a look at it? Thanks!

@perebusquets
Copy link

Hi, is this being actively maintained? This PR was open by over 8 months. I get it if you can't maintain it, but please mark it as archived so people can fork this project and maintain it properly if necessary. Thank you for your time.

@AstraLuma
Copy link

AstraLuma commented Sep 30, 2024

I'm thinking of tackling this in a more comprehensive way, since there's about a dozen config variables that need to be resolved in about four different code paths.

EDIT: #72

@AstraLuma AstraLuma linked a pull request Oct 1, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants