1. Caddy version (caddy version):
v2.4.6 h1:HGkGICFGvyrodcqOOclHKfvJC0qTU7vny/7FhYp9hNw=
2. How I run Caddy:
Systemd
a. System environment:
Debian , Caddy compiled no .deb Package Version
d. My complete Caddyfile or JSON config:
{
debug
on_demand_tls {
ask http://{$API}/check/html
interval 2m
burst 5
}
storage s3 {
host {$AWS_HOST}
bucket {$CONFIG}
access_id {$AWS_ACCESS_KEY_ID}
secret_key {$AWS_SECRET_ACCESS_KEY}
insecure false
prefix "ssl"
}
order s3proxy first
servers {
protocol {
experimental_http3
}
}
}
https:// {
tls {
on_demand
}
encode zstd gzip
@wraxx header_regexp sub Host (.*)\.hi.{$PROVIDER}
handle @wraxx {
s3proxy {
bucket {$SITES}
region {$AWS_REGION}
endpoint {$AWS_HOST}
index index.html
root /{re.sub.1}
errors /{re.sub.1}/index.html
}
@cdn not path / */ *.html *.htm
redir @cdn https://cdn.{$PROVIDER}/{re.sub.1}{uri} permanent
}
handle /formmailer {
reverse_proxy {$API} {
header_up Secure {host}
header_up X-Forwarded-Host {host}
header_up Authentication {$API_AUTH}
}
}
handle {
s3proxy {
bucket {$SITES}
region {$AWS_REGION}
endpoint {$AWS_HOST}
index index.html
root /{host}
errors /{host}/index.html
}
@cdn not path / */ *.html *.htm
redir @cdn https://cdn.{$PROVIDER}/{host}{uri} permanent
}
}
3. The problem I’m having:
Every other Requests I will encounter empty host headers from the same Browser Session (Refresh CTRL+R, Tested with Firefox and Chrome. Works with curl) and the log file will show {http.request.host} insted of the hostname. How can I handle this empty host variables?
4. Error messages and/or full log output:
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"}
5. What I already tried:
I tried deactivate the s3proxy. Problem still existed.