Corrige le cache des mises à jour LXC

This commit is contained in:
2026-04-12 14:59:12 +02:00
parent 15528c2062
commit d5db7d7ea4
2 changed files with 86 additions and 3 deletions

View File

@@ -362,6 +362,7 @@ fi
git fetch origin \"\$branch\"
git pull --ff-only origin \"\$branch\"
asset_version=\"\$(git rev-parse --short HEAD)\"
install -d -m 0755 \"\$web_root\"
@@ -380,6 +381,10 @@ rsync -a --delete \
--exclude='*' \
\"\$repo_dir/\" \"\$web_root/\"
while IFS= read -r -d '' html_file; do
perl -0pi -e 's{((?:href|src)=\")(?!https?://|data:|//)([^\"?]+?\.(?:css|js|png|jpg|jpeg|svg|webp|ico|pdf))(?:\?[^"]*)?(\")}{\$1 . \$2 . \"?v='"\"\$asset_version\""'\" . \$3}ge' \"\$html_file\"
done < <(find \"\$web_root\" -maxdepth 1 -type f -name '*.html' -print0)
chown -R www-data:www-data \"\$web_root\"
nginx -t
@@ -401,8 +406,8 @@ server {
}
location ~* \.(?:css|js|png|jpg|jpeg|svg|webp|ico|pdf)$ {
expires 7d;
add_header Cache-Control 'public, max-age=604800';
expires -1;
add_header Cache-Control 'no-cache, no-store, must-revalidate';
}
}
NGINX