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) => (