rewrite: Vite+React → Astro 5 + Content Collections
Some checks failed
deploy / deploy (push) Failing after 12s
Some checks failed
deploy / deploy (push) Failing after 12s
- Бэкап старой версии на ветке vite-react-backup - Stack: Astro 5 + nginx:alpine runtime, образ ~50 МБ (был ~600 МБ) - @astrojs/rss заменён ручным buildRss() — гарантия CDATA в content:encoded для IPB Importer - @astrojs/sitemap → sitemap-index.xml + sitemap.txt - 152-ФЗ cookie consent + privacy.astro + Analytics с gating - AI-файлы: robots.txt с явным allow для AI-краулеров, ai.txt, llms.txt - Гибридный визуал: фото-фон шапки (аэрофото Пушкино) + PT Serif + IBM Plex Sans - Иерархия: hero "Главная история" с рамкой + "Ещё из истории" + "Хроника" - Категория "main" (псевдо) скрыта из плашек и из Рубрик в сайдбаре - hideFromList: true для технических постов - featuredImage в frontmatter для постов без хорошей первой <img> - WP resized-URL (-WxH.ext) автоматически → оригинал - CI/CD: .gitea/workflows/deploy.yml (push → SSH-build) - Внешние RSS: scripts/pull-external-rss.mjs пишет news.json в bind-mount, фронт фетчит client-side
This commit is contained in:
91
nginx.conf
Normal file
91
nginx.conf
Normal file
@@ -0,0 +1,91 @@
|
||||
# nginx-конфиг внутри контейнера. TLS терминируется на хосте (web.hhivp.com).
|
||||
server {
|
||||
listen 80 default_server;
|
||||
server_name _;
|
||||
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
|
||||
access_log /dev/stdout;
|
||||
error_log /dev/stderr warn;
|
||||
|
||||
location ~ /\.(?!well-known) {
|
||||
deny all;
|
||||
log_not_found off;
|
||||
access_log off;
|
||||
}
|
||||
|
||||
gzip on;
|
||||
gzip_vary on;
|
||||
gzip_min_length 256;
|
||||
gzip_proxied any;
|
||||
gzip_comp_level 6;
|
||||
gzip_types
|
||||
text/plain text/css text/xml
|
||||
application/json application/xml application/rss+xml application/atom+xml
|
||||
application/javascript application/x-javascript
|
||||
image/svg+xml font/woff2;
|
||||
|
||||
# RSS-фиды: явный Content-Type для IPB RSS Importer
|
||||
location = /feed.xml {
|
||||
types { } default_type application/rss+xml;
|
||||
charset utf-8;
|
||||
try_files /feed.xml =404;
|
||||
expires 5m;
|
||||
add_header Cache-Control "public, max-age=300, must-revalidate";
|
||||
}
|
||||
location ~ ^/cat/[^/]+/feed\.xml$ {
|
||||
types { } default_type application/rss+xml;
|
||||
charset utf-8;
|
||||
expires 5m;
|
||||
add_header Cache-Control "public, max-age=300, must-revalidate";
|
||||
}
|
||||
location = /sitemap.txt { default_type text/plain; charset utf-8; }
|
||||
location = /robots.txt { default_type text/plain; charset utf-8; }
|
||||
location = /ai.txt { default_type text/plain; charset utf-8; }
|
||||
location = /llms.txt { default_type text/plain; charset utf-8; }
|
||||
|
||||
# Агрегатор новостей: cron на хосте пишет в /var/lib/pushkino/data/news.json (bind-mount)
|
||||
location = /api/news.json {
|
||||
alias /var/lib/pushkino/data/news.json;
|
||||
default_type application/json;
|
||||
charset utf-8;
|
||||
add_header Cache-Control "public, max-age=120, must-revalidate";
|
||||
# Если файл не создан cron'ом — отдадим пустую структуру
|
||||
try_files $uri @news_fallback;
|
||||
}
|
||||
location @news_fallback {
|
||||
default_type application/json;
|
||||
return 200 '{"updatedAt":null,"items":[]}';
|
||||
}
|
||||
|
||||
# Кэш статических ассетов Astro (хеш в имени)
|
||||
location /_astro/ {
|
||||
expires 1y;
|
||||
add_header Cache-Control "public, immutable, max-age=31536000";
|
||||
access_log off;
|
||||
}
|
||||
location /uploads/ {
|
||||
expires 30d;
|
||||
add_header Cache-Control "public, max-age=2592000";
|
||||
access_log off;
|
||||
}
|
||||
location ~* \.(?:css|js|woff2?|ttf|otf|eot)$ {
|
||||
expires 30d;
|
||||
add_header Cache-Control "public, max-age=2592000";
|
||||
access_log off;
|
||||
}
|
||||
location ~* \.(?:png|jpe?g|gif|svg|webp|avif|ico)$ {
|
||||
expires 30d;
|
||||
add_header Cache-Control "public, max-age=2592000";
|
||||
access_log off;
|
||||
}
|
||||
|
||||
# Маршрутизация: Astro генерит dir/index.html
|
||||
location / {
|
||||
try_files $uri $uri/ $uri.html =404;
|
||||
}
|
||||
|
||||
error_page 404 /404.html;
|
||||
location = /404.html { internal; }
|
||||
}
|
||||
Reference in New Issue
Block a user