- Add @adminjs/upload for image management (JPEG/PNG/WebP, max 5MB) - Auto-compute imagePath, ogImage, slug, seoTitle, seoDescription - Stripe price auto-sync on product create/edit - Serve uploads via Fastify + nginx /uploads/ location - Add imageKey/imageMime fields to schema - Hide technical fields from admin edit form - Add uploads/ and SQLite DB to .gitignore Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
70 lines
3.1 KiB
Nginx Configuration File
70 lines
3.1 KiB
Nginx Configuration File
server {
|
|
listen 80;
|
|
server_name rebours.studio;
|
|
|
|
root /var/www/html/rebours/dist;
|
|
index index.html;
|
|
|
|
# ── API proxy → Fastify ──────────────────────────────────────────────────
|
|
location /api/ {
|
|
proxy_pass http://127.0.0.1:3000;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto https;
|
|
}
|
|
|
|
# ── SEO (dynamique depuis DB) ────────────────────────────────────────────
|
|
location = /robots.txt {
|
|
proxy_pass http://127.0.0.1:3000;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
}
|
|
|
|
location = /sitemap.xml {
|
|
proxy_pass http://127.0.0.1:3000;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
}
|
|
|
|
# ── Admin proxy → Fastify (AdminJS) ──────────────────────────────────────
|
|
location ^~ /admin {
|
|
proxy_pass http://127.0.0.1:3000;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto https;
|
|
}
|
|
|
|
# ── Uploads (images produits depuis admin) ────────────────────────────────
|
|
location /uploads/ {
|
|
alias /var/www/html/rebours/uploads/;
|
|
add_header Cache-Control "public, max-age=604800";
|
|
}
|
|
|
|
# ── Cache : Astro hashed → immutable ─────────────────────────────────────
|
|
location /_astro/ {
|
|
add_header Cache-Control "public, max-age=31536000, immutable";
|
|
}
|
|
|
|
# ── Cache : CSS/JS sans hash → revalidation ─────────────────────────────
|
|
location ~* \.(css|js)$ {
|
|
add_header Cache-Control "no-cache";
|
|
}
|
|
|
|
# ── Cache : assets → 7 jours ────────────────────────────────────────────
|
|
location ~* \.(jpg|jpeg|png|gif|webp|svg|woff2|woff|ttf|ico)$ {
|
|
add_header Cache-Control "public, max-age=604800";
|
|
}
|
|
|
|
# ── HTML : jamais caché ──────────────────────────────────────────────────
|
|
location ~* \.html$ {
|
|
add_header Cache-Control "no-store";
|
|
}
|
|
|
|
# ── SPA fallback ─────────────────────────────────────────────────────────
|
|
location / {
|
|
try_files $uri $uri/ $uri.html /index.html;
|
|
}
|
|
}
|