Files
bentopdf/nginx.conf

92 lines
2.4 KiB
Nginx Configuration File
Raw Normal View History

pid /etc/nginx/tmp/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
types {
application/javascript mjs;
}
default_type application/octet-stream;
gzip_static on;
2026-04-17 23:40:24 +05:30
gzip on;
gzip_vary on;
gzip_min_length 1024;
gzip_comp_level 9;
gzip_types text/plain text/css text/xml text/javascript application/javascript application/xml+rss application/json application/wasm application/x-javascript text/x-component;
server {
listen 8080;
listen [::]:8080;
server_name localhost;
root /usr/share/nginx/html;
index index.html;
absolute_redirect off;
2026-04-17 23:40:24 +05:30
include /etc/nginx/security-headers.conf;
2026-03-14 14:48:49 +03:00
location ~ ^/(en|ar|be|da|de|es|fr|id|it|ko|nl|pt|ru|sv|tr|vi|zh|zh-TW)(/.*)?$ {
try_files $uri $uri/ $uri.html /$1/index.html /index.html;
expires 5m;
}
2026-03-14 14:48:49 +03:00
location ~ ^/(.+?)/(en|ar|be|da|de|es|fr|id|it|ko|nl|pt|ru|sv|tr|vi|zh|zh-TW)(/.*)?$ {
try_files $uri $uri/ $uri.html /$1/$2/index.html /$1/index.html /index.html;
expires 5m;
}
location ~* \.html$ {
expires 1h;
}
location ~* /libreoffice-wasm/soffice\.wasm\.gz$ {
gzip off;
types {} default_type application/wasm;
add_header Content-Encoding gzip;
add_header Vary "Accept-Encoding";
2026-04-17 23:40:24 +05:30
include /etc/nginx/security-headers.conf;
expires 1y;
}
location ~* /libreoffice-wasm/soffice\.data\.gz$ {
gzip off;
types {} default_type application/octet-stream;
add_header Content-Encoding gzip;
add_header Vary "Accept-Encoding";
2026-04-17 23:40:24 +05:30
include /etc/nginx/security-headers.conf;
expires 1y;
}
location ~* \.(wasm|wasm\.gz|data|data\.gz)$ {
expires 1y;
}
location ~* \.(js|mjs|css|woff|woff2|ttf|eot|otf)$ {
expires 1y;
}
location ~* \.(png|jpg|jpeg|gif|ico|svg|webp|avif|mp4|webm)$ {
expires 1y;
}
location ~* \.json$ {
expires 1w;
}
location ~* \.pdf$ {
expires 1y;
}
error_page 404 /404.html;
location / {
try_files $uri $uri/ $uri.html =404;
expires 5m;
}
}
}