From 166af639d450e55bfd402c95d7e16abb4527b6e6 Mon Sep 17 00:00:00 2001 From: Lanskikh Date: Thu, 22 Jan 2026 14:43:14 +0500 Subject: [PATCH] upd --- .gitignore | 1 + graff.estate.conf | 13 +++++++++++-- src/app/not-found.tsx | 3 +-- src/ui/StoriesButton.tsx | 2 +- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 3359153b..e8928b7f 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,7 @@ # production /build +/dist # misc .DS_Store diff --git a/graff.estate.conf b/graff.estate.conf index 2562ce02..39660c26 100644 --- a/graff.estate.conf +++ b/graff.estate.conf @@ -18,9 +18,18 @@ server { # index.html fallback location / { - # try_files $uri $uri/ /index.html; - try_files $uri $uri.html $uri/ /index.html; + # Убираем trailing slash и редиректим + rewrite ^/(.*)/$ /$1 permanent; + + # Пробуем найти файл, затем с .html, затем 404 + try_files $uri $uri.html /404.html; } + + # Явная обработка 404 + # error_page 404 /404.html; + # location = /404.html { + # internal; + # } location /api { diff --git a/src/app/not-found.tsx b/src/app/not-found.tsx index a04dc746..6c21ed63 100644 --- a/src/app/not-found.tsx +++ b/src/app/not-found.tsx @@ -1,8 +1,7 @@ -import { redirect, RedirectType } from "next/navigation"; import MainLayout from "./(main)/layout"; import { NotFoundPage } from "@/components/pages/NotFoundPage"; -export default function Page() { +export default function NotFound() { return ( diff --git a/src/ui/StoriesButton.tsx b/src/ui/StoriesButton.tsx index 34dc3131..a9e72292 100644 --- a/src/ui/StoriesButton.tsx +++ b/src/ui/StoriesButton.tsx @@ -17,7 +17,7 @@ export function StoriesButton() { return (
- {stories?.slice(-3).map(({ id, text, preview }, index) => ( + {stories?.slice(0,3).map(({ id, text, preview }, index) => (