fix(bentopdf): serve libreoffice wasm gz with correct nginx headers

Fix Word/Excel conversion hang by serving /libreoffice-wasm assets with
proper MIME types and Content-Encoding.

- serve soffice.wasm.gz as application/wasm + Content-Encoding: gzip
- serve soffice.data.gz as octet-stream + Content-Encoding: gzip
- add immutable caching for wasm/data assets
- always refresh nginx site+service during update to migrate existing installs
- switch install script dependency handling to ensure_dependencies nginx
This commit is contained in:
CanbiZ (MickLesk)
2026-04-10 08:20:19 +02:00
parent 9120546c26
commit c0d12a797a
2 changed files with 60 additions and 9 deletions
+27 -1
View File
@@ -13,7 +13,6 @@ setting_up_container
network_check
update_os
msg_info "Installing Dependencies"
$STD apt install nginx -y
msg_ok "Installed Dependencies"
@@ -48,6 +47,33 @@ server {
gzip_static on;
location ~* /libreoffice-wasm/soffice\.wasm\.gz$ {
gzip off;
types {} default_type application/wasm;
add_header Content-Encoding gzip;
add_header Vary "Accept-Encoding";
add_header Cache-Control "public, immutable";
}
location ~* /libreoffice-wasm/soffice\.data\.gz$ {
gzip off;
types {} default_type application/octet-stream;
add_header Content-Encoding gzip;
add_header Vary "Accept-Encoding";
add_header Cache-Control "public, immutable";
}
location ~* \.wasm$ {
types {} default_type application/wasm;
expires 1y;
add_header Cache-Control "public, immutable";
}
location ~* \.(wasm\.gz|data\.gz|data)$ {
expires 1y;
add_header Cache-Control "public, immutable";
}
location / {
try_files $uri $uri/ $uri.html =404;
}