feat(deploy): production deployment setup and fixes
- Debian-based api image (bookworm-slim), docker/debian mirrors, prisma binaryTargets for openssl 3.0 - nginx: admin SPA under /admin, TLS via acme.sh (ZeroSSL) + auto-renewal cron, http->https redirect - prisma: add origin_goods.delisted migration, sync missing schema (good_image/tag_font_color/good_tags), fix users.createdAt Timestamptz - api: CORS wildcard reflection, helmet CORP cross-origin, price backfill in persistProductDetail, categoryIcon ancestor fallback, mediaByColor per-color gallery in public goods detail - admin: /admin base path (vite + router) - import-data.mjs: udt_name casting, serial sequence advance fix
This commit is contained in:
@@ -0,0 +1,68 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name official.inkreach.cc;
|
||||
|
||||
client_max_body_size 10m;
|
||||
|
||||
# ACME challenge for cert renewals
|
||||
location /.well-known/acme-challenge/ {
|
||||
root /var/www/certbot;
|
||||
}
|
||||
|
||||
location / {
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443 ssl;
|
||||
http2 on;
|
||||
server_name official.inkreach.cc;
|
||||
|
||||
ssl_certificate /etc/nginx/certs/official.inkreach.cc_ecc/fullchain.cer;
|
||||
ssl_certificate_key /etc/nginx/certs/official.inkreach.cc_ecc/official.inkreach.cc.key;
|
||||
ssl_protocols TLSv1.2 TLSv1.3;
|
||||
|
||||
client_max_body_size 10m;
|
||||
|
||||
root /usr/share/nginx/html;
|
||||
|
||||
location /.well-known/acme-challenge/ {
|
||||
root /var/www/certbot;
|
||||
}
|
||||
|
||||
# Admin SPA
|
||||
location /admin/ {
|
||||
try_files $uri $uri/ /admin/index.html;
|
||||
}
|
||||
location = /admin {
|
||||
return 301 /admin/;
|
||||
}
|
||||
|
||||
# API: strip the /api prefix before proxying to the NestJS container
|
||||
location /api/ {
|
||||
proxy_pass http://api:3001/;
|
||||
proxy_http_version 1.1;
|
||||
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 $scheme;
|
||||
}
|
||||
|
||||
# Uploaded files served by the API
|
||||
location /uploads/ {
|
||||
proxy_pass http://api:3001/uploads/;
|
||||
proxy_set_header Host $host;
|
||||
}
|
||||
|
||||
# Static product assets served by the API
|
||||
location /assets/ {
|
||||
proxy_pass http://api:3001/assets/;
|
||||
proxy_set_header Host $host;
|
||||
}
|
||||
|
||||
# Website placeholder until the public site is deployed
|
||||
location / {
|
||||
return 302 /admin/;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user