From 71424ca5f4245f304069d5cc2e0c08b9d959d7ab Mon Sep 17 00:00:00 2001 From: sova-bootstrap Date: Thu, 28 May 2026 13:48:25 +0300 Subject: [PATCH] fix: nginx cleanUrls routing for VitePress guides --- .vitepress/config.mts | 2 +- .../test-contour/guides/{index.md => overview.md} | 2 +- infrastructure/test-contour/index.md | 2 +- nginx.conf | 7 +++++-- 4 files changed, 8 insertions(+), 5 deletions(-) rename infrastructure/test-contour/guides/{index.md => overview.md} (94%) diff --git a/.vitepress/config.mts b/.vitepress/config.mts index f2b720c..d6427e4 100644 --- a/.vitepress/config.mts +++ b/.vitepress/config.mts @@ -99,7 +99,7 @@ export default defineConfig({ collapsed: false, items: [ { text: 'Обзор', link: '/infrastructure/test-contour/' }, - { text: 'Визуальные гайды', link: '/infrastructure/test-contour/guides/' }, + { text: 'Визуальные гайды', link: '/infrastructure/test-contour/guides/overview' }, { text: 'Gitea: теги и CI/CD', link: '/infrastructure/test-contour/guides/gitea-ci' }, { text: 'ArgoCD: приложения', link: '/infrastructure/test-contour/guides/argocd' }, { text: 'Grafana / Prometheus / Loki', link: '/infrastructure/test-contour/guides/monitoring' }, diff --git a/infrastructure/test-contour/guides/index.md b/infrastructure/test-contour/guides/overview.md similarity index 94% rename from infrastructure/test-contour/guides/index.md rename to infrastructure/test-contour/guides/overview.md index 1296179..f749b85 100644 --- a/infrastructure/test-contour/guides/index.md +++ b/infrastructure/test-contour/guides/overview.md @@ -1,4 +1,4 @@ -# Визуальные гайды test-контура +# Визуальные гайды test-контура {#overview} Пошаговые инструкции со **скриншотами** реального UI песочницы: Gitea CI, ArgoCD, Grafana, Prometheus и Loki. diff --git a/infrastructure/test-contour/index.md b/infrastructure/test-contour/index.md index 5fdc5ae..5ac5f8f 100644 --- a/infrastructure/test-contour/index.md +++ b/infrastructure/test-contour/index.md @@ -8,7 +8,7 @@ ### Визуальные гайды (скриншоты) -- [Обзор гайдов](./guides/) — Gitea, ArgoCD, Grafana, Prometheus, Loki +- [Обзор гайдов](./overview) — Gitea, ArgoCD, Grafana, Prometheus, Loki - [Gitea: теги и CI/CD](./guides/gitea-ci) - [ArgoCD: приложения](./guides/argocd) - [Grafana / Prometheus / Loki](./guides/monitoring) diff --git a/nginx.conf b/nginx.conf index 65a3d1c..c8ffc61 100644 --- a/nginx.conf +++ b/nginx.conf @@ -4,11 +4,14 @@ server { root /usr/share/nginx/html; index index.html; + # VitePress cleanUrls: each page is a *.html file on disk location / { - try_files $uri $uri/ $uri/index.html /index.html; + try_files $uri $uri.html $uri/ $uri/index.html =404; } - location ~* \.(html|css|js|json|svg|woff2?|png|jpg|jpeg|gif|ico)$ { + location ~* \.(html|css|js|json|svg|woff2?|png|jpg|jpeg|gif|ico|webp)$ { add_header Cache-Control "public, max-age=3600"; } + + error_page 404 /404.html; }