fix bugs an local
This commit is contained in:
1 parent
1380a4dfc8
commit
b2a790337e
24 files changed
+490
-334
No files matched your search
+75
-15
@@ -1,34 +1,83 @@
|
||||
# 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;
|
||||
~^/index(?:\.html)?/?$ /;
|
||||
~^/(business-animation|contacts|legal|personal-animation|portfolio|services|social-animation)(?:\.html/?|/)$ /$1;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name www.olapka.ru;
|
||||
|
||||
return 301 https://olapka.ru$request_uri;
|
||||
return 301 https://olapka.ru$olapka_canonical_path$is_args$args;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name olapka.ru;
|
||||
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
charset utf-8;
|
||||
charset_types text/plain text/css text/markdown application/javascript application/json application/xml image/svg+xml;
|
||||
|
||||
# Отдельная страница ошибки 404
|
||||
error_page 404 /404.html;
|
||||
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;
|
||||
|
||||
# Убираем .html из исходных запросов браузера
|
||||
if ($request_uri ~ ^(/[^?]*)\.html(\?.*)?$) {
|
||||
return 301 $1$is_args$args;
|
||||
# /404 is an error too, never a successful content page.
|
||||
location = /404 {
|
||||
return 404;
|
||||
}
|
||||
|
||||
location / {
|
||||
try_files $uri $uri.html $uri/ =404;
|
||||
}
|
||||
error_page 404 =404 /404.html;
|
||||
|
||||
# Доступ только для внутренней обработки ошибки
|
||||
location = /404.html {
|
||||
internal;
|
||||
}
|
||||
# Machine-readable site summaries (UTF-8 Markdown in .txt files).
|
||||
|
||||
# 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;
|
||||
}
|
||||
|
||||
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).
|
||||
location ~ ^/llms(?:-full)?\.txt$ {
|
||||
types { }
|
||||
default_type text/plain;
|
||||
@@ -55,4 +104,15 @@ server {
|
||||
add_header Link '</llms.txt>; rel="describedby"';
|
||||
try_files $uri =404;
|
||||
}
|
||||
}
|
||||
|
||||
# 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;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user