This commit is contained in:
alexencom committed 2026-10-31 01:20:15 +03:00
1 parent 6addd97a93
commit e355cb8f33
3 files changed
+89 -3

No files matched your search

+16 -3
View File
@@ -12,7 +12,20 @@ server {
root /usr/share/nginx/html;
index index.html;
location / {
try_files $uri $uri/ =404;
# Отдельная страница ошибки 404
error_page 404 /404.html;
# Убираем .html из исходных запросов браузера
if ($request_uri ~ ^(/[^?]*)\.html(\?.*)?$) {
return 301 $1$is_args$args;
}
}
location / {
try_files $uri $uri.html $uri/ =404;
}
# Доступ только для внутренней обработки ошибки
location = /404.html {
internal;
}
}