I have been using the gzip directive for a long time now, and today I decided to templatize my site. When I added the templates directive and tried to load the site, Firefox gave me the “Download dialogue” to download the .gzip file.
When I download and open it, it does contain the correct web page, with the template lines replaced by their proper files. Is this a gzip or templates bug?
Could you please give us more information to identify your problem?
- What’s your CaddyFile?
- What’s your template file?
- Dump log if any. (run caddy with option: -log stdout)
Thanks.
1 Like
Caddyfile
https://XXXXXXXXX.XXXXXXX.ME {
root /var/www/millhousenchurch
gzip
templates
tls XXXXXXX@XXXXXXX.me {
protocols tls1.0 tls1.2
}
log /var/www/logs/millhousenchurch.log
git https://github.com/19kestier/millhousenchurch.com.git {
hook /XXXXXXXXX XXXXXXXXXXXXXXXX
}
errors {
log /var/www/logs/millhousenchurch-error.log
404 /errors/404.html
}
browse /bulletins/files /var/www/millhousenchurch/templates/browse.html
header / {
Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
Public-Key-Pins "pin-sha256=\"Vjs8r4z+80wjNcr1YKepWQboSIRi63WsWXhIMN+eWys=\"; pin-sha256=\"C5+lpZ7tcVwmwQIMcRtPbsQtWLABXhQzejna0wHFr8M=\"; pin-sha256=\"YLh1dUR9y6Kja30RrAn7JKnbQG/uEtLMkBgFF2Fuihg=\"; pin-sha256=\"Pr2hOJcdTcz63ucsPIH9XAJazPWZHdSMfAeb9lYWC5Q=\"; pin-sha256=\"klO23nT2ehFDXCfx3eHTDRESMz3asj1muO+4aIdjiuY=\"; pin-sha256=\"SMAnK9nweWoTAdwp1LVMG7hJIulUolcsTHwr2h7Kw3Y=\"; pin-sha256=\"5Flr8i4NX99DWqi7Ot0z2WoboW9myiaH1BvpgRpFMIk=\"; includeSubdomains; max-age=2592000; report-uri=\"https://flexstart.report-uri.io/r/default/hpkp/enforce\" "
X-Frame-Options "SAMEORIGIN"
X-XSS-Protection "1; mode=block"
X-Content-Type-Options "nosniff"
}
expires {
match .js$ 1m
# expires js files after 30 days
match .png$ 1y
# expires png files after one year
match .jpg$ 1y
# expires jpg files after one year
match .pdf$ 1m
# expires pdf file after one month
match .txt$ 1m
# expires txt files after one month
match .html$ 7d
# expires html files after one week
match .css$ 7d
# expires css files after one week
}
}
Before I added templates, everything worked fine.
After I added it, it gave me this bug.
Now that I’ve removed gzip, everything works fine again. (but compression is important!)
Files to Serve
Homepage uses templates (head.html, header.html, footer.html)
The Caddy log shows no errors relevant to the situation.
I updated Caddy to the latest version, and no longer have issues. Thanks!
1 Like
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.