Files
alam00000 0040317e48 feat(seo): canonicalize URLs, clean structured data, add audit gate
- Canonicals/hreflang/og point to www.bentopdf.com everywhere
- Drop fake aggregateRating; add Organization + breadcrumb JSON-LD
- Sitemap: filter 404/wasm-settings, mtime-based lastmod
- Rename locale ua → uk (correct ISO 639-1)
- Self-hoster: SITE_URL build arg, ROBOTS_NOINDEX runtime env
- Simple Mode indexable by default
- nginx: collapse .html and /index.html via 301
- SEO audit script + PR gate; runtime config noise fixed
- a11y contrast fix; language switcher gets search + scroll
- robots.txt: drop Crawl-delay
2026-04-29 12:04:34 +05:30

115 lines
3.1 KiB
Nginx Configuration File

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;
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;
include /etc/nginx/security-headers.conf;
location ^~ /pdfjs-viewer/ {
try_files $uri =404;
expires 1y;
}
location ^~ /pdfjs-annotation-viewer/ {
try_files $uri =404;
expires 1y;
}
if ($request_uri ~ ^(/(?:en|ar|be|da|de|es|fr|id|it|ko|nl|pt|ru|sv|tr|vi|zh|zh-TW|uk|ja))?/index\.html(\?.*)?$) {
return 301 $1/$2;
}
if ($request_uri ~ ^(/(?:en|ar|be|da|de|es|fr|id|it|ko|nl|pt|ru|sv|tr|vi|zh|zh-TW|uk|ja))?/([a-z0-9][a-z0-9-]*)\.html(\?.*)?$) {
return 301 $1/$2$3;
}
location ~ ^/(en|ar|be|da|de|es|fr|id|it|ko|nl|pt|ru|sv|tr|vi|zh|zh-TW|uk|ja)(/.*)?$ {
try_files $uri $uri/ $uri.html /$1/index.html /index.html;
expires 5m;
}
location ~ ^/(.+?)/(en|ar|be|da|de|es|fr|id|it|ko|nl|pt|ru|sv|tr|vi|zh|zh-TW|uk|ja)(/.*)?$ {
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";
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";
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 ^~ /docs/ {
include /etc/nginx/security-headers-docs.conf;
try_files $uri $uri/ $uri.html /docs/index.html =404;
expires 5m;
}
location / {
try_files $uri $uri/ $uri.html =404;
expires 5m;
}
}
}