2026-11-01 11:48:59 +03:00
|
|
|
# Loaded by the standard nginx image inside the http context.
|
|
|
|
|
# TLS is terminated by the existing external reverse proxy (Pangolin).
|
|
|
|
|
map $uri $olapka_canonical_path {
|
|
|
|
|
# Re-evaluate after internal error_page redirects.
|
|
|
|
|
volatile;
|
|
|
|
|
default $uri;
|
2026-11-08 23:45:52 +03:00
|
|
|
~^/new-year(?:\.html)?/?$ /;
|
2026-11-01 11:48:59 +03:00
|
|
|
~^/index(?:\.html)?/?$ /;
|
|
|
|
|
~^/(business-animation|contacts|legal|personal-animation|portfolio|services|social-animation)(?:\.html/?|/)$ /$1;
|
|
|
|
|
}
|
|
|
|
|
|
2026-10-30 21:59:08 +03:00
|
|
|
server {
|
|
|
|
|
listen 80;
|
|
|
|
|
server_name www.olapka.ru;
|
2026-11-01 11:48:59 +03:00
|
|
|
return 301 https://olapka.ru$olapka_canonical_path$is_args$args;
|
2026-10-30 21:59:08 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
server {
|
|
|
|
|
listen 80;
|
|
|
|
|
server_name olapka.ru;
|
|
|
|
|
root /usr/share/nginx/html;
|
2026-11-01 11:48:59 +03:00
|
|
|
charset utf-8;
|
|
|
|
|
charset_types text/plain text/css text/markdown application/javascript application/json application/xml image/svg+xml;
|
2026-10-30 21:59:08 +03:00
|
|
|
|
2026-11-01 11:48:59 +03:00
|
|
|
gzip on;
|
|
|
|
|
gzip_vary on;
|
|
|
|
|
gzip_proxied any;
|
|
|
|
|
gzip_min_length 512;
|
|
|
|
|
gzip_comp_level 5;
|
|
|
|
|
gzip_types text/plain text/css text/markdown application/javascript application/json application/xml text/xml image/svg+xml;
|
2026-10-31 01:20:15 +03:00
|
|
|
|
2026-11-01 11:48:59 +03:00
|
|
|
# /404 is an error too, never a successful content page.
|
|
|
|
|
location = /404 {
|
|
|
|
|
return 404;
|
2026-10-30 21:59:08 +03:00
|
|
|
}
|
2026-10-31 01:20:15 +03:00
|
|
|
|
2026-11-01 11:48:59 +03:00
|
|
|
error_page 404 =404 /404.html;
|
2026-10-31 01:20:15 +03:00
|
|
|
|
|
|
|
|
location = /404.html {
|
|
|
|
|
internal;
|
|
|
|
|
}
|
2026-11-01 11:48:59 +03:00
|
|
|
|
|
|
|
|
# Only return redirects here; no rewrite loops or HTTPS checks behind proxy.
|
|
|
|
|
if ($uri != $olapka_canonical_path) {
|
|
|
|
|
return 301 https://olapka.ru$olapka_canonical_path$is_args$args;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# try_files serves an existing file in-place, without a client redirect.
|
|
|
|
|
location = / {
|
|
|
|
|
try_files /index.html =404;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
location = /business-animation {
|
|
|
|
|
try_files /business-animation.html =404;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
location = /contacts {
|
|
|
|
|
try_files /contacts.html =404;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
location = /legal {
|
|
|
|
|
try_files /legal.html =404;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
location = /personal-animation {
|
|
|
|
|
try_files /personal-animation.html =404;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
location = /portfolio {
|
|
|
|
|
try_files /portfolio.html =404;
|
|
|
|
|
}
|
|
|
|
|
|
2026-11-08 23:45:52 +03:00
|
|
|
location = /new-year.md {
|
|
|
|
|
return 301 /index.md$is_args$args;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
location = /new-year {
|
|
|
|
|
return 301 /$is_args$args;
|
|
|
|
|
}
|
|
|
|
|
|
2026-11-01 11:48:59 +03:00
|
|
|
location = /services {
|
|
|
|
|
try_files /services.html =404;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
location = /social-animation {
|
|
|
|
|
try_files /social-animation.html =404;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Machine-readable site summaries (UTF-8 Markdown in .txt files).
|
2026-10-31 21:29:12 +03:00
|
|
|
location ~ ^/llms(?:-full)?\.txt$ {
|
|
|
|
|
types { }
|
|
|
|
|
default_type text/plain;
|
|
|
|
|
charset utf-8;
|
|
|
|
|
add_header Cache-Control "public, max-age=3600";
|
|
|
|
|
try_files $uri =404;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Keep the source legal page's noindex policy on its Markdown copy.
|
|
|
|
|
location = /legal.md {
|
|
|
|
|
types { }
|
|
|
|
|
default_type text/markdown;
|
|
|
|
|
charset utf-8;
|
|
|
|
|
add_header X-Robots-Tag "noindex, follow";
|
|
|
|
|
add_header Link '</llms.txt>; rel="describedby"';
|
|
|
|
|
try_files $uri =404;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
location ~ ^/(index|services|personal-animation|business-animation|social-animation|portfolio|contacts)\.md$ {
|
|
|
|
|
types { }
|
|
|
|
|
default_type text/markdown;
|
|
|
|
|
charset utf-8;
|
|
|
|
|
add_header Cache-Control "public, max-age=3600";
|
|
|
|
|
add_header Link '</llms.txt>; rel="describedby"';
|
|
|
|
|
try_files $uri =404;
|
|
|
|
|
}
|
2026-11-01 11:48:59 +03:00
|
|
|
|
|
|
|
|
# Revalidate changed assets after one hour (filenames are not versioned).
|
|
|
|
|
location ~ ^/(?:css|js|img|video)/ {
|
|
|
|
|
add_header Cache-Control "public, max-age=3600";
|
|
|
|
|
try_files $uri =404;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Real assets are served normally. Unknown URLs return a real 404.
|
|
|
|
|
location / {
|
|
|
|
|
try_files $uri =404;
|
|
|
|
|
}
|
|
|
|
|
}
|