From fc6bf0218e3d3c08bef2f955a6fb229ce633dd04 Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 3 Jun 2026 09:28:22 +0700 Subject: [PATCH] x --- apps/backend/prisma/seed.cjs | 4 +++- serverinfo/homaroma.shop.conf | 25 ++++++++++++++++++++++--- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/apps/backend/prisma/seed.cjs b/apps/backend/prisma/seed.cjs index e511d8f..e82dff2 100644 --- a/apps/backend/prisma/seed.cjs +++ b/apps/backend/prisma/seed.cjs @@ -3,10 +3,12 @@ const fs = require('fs'); const path = require('path'); const { PrismaClient } = require('@prisma/client'); +const { Pool } = require('pg'); const { PrismaPg } = require('@prisma/adapter-pg'); const bcrypt = require('bcryptjs'); -const adapter = new PrismaPg({ connectionString: process.env.DATABASE_URL }); +const pool = new Pool({ connectionString: process.env.DATABASE_URL }); +const adapter = new PrismaPg(pool); const prisma = new PrismaClient({ adapter }); const scentNames = [ diff --git a/serverinfo/homaroma.shop.conf b/serverinfo/homaroma.shop.conf index 9a4f82a..a3a5bdc 100644 --- a/serverinfo/homaroma.shop.conf +++ b/serverinfo/homaroma.shop.conf @@ -1,21 +1,40 @@ server { listen 80; server_name homaroma.shop www.homaroma.shop; - location ~ /.well-known/acme-challenge { - allow all; + + location /.well-known/acme-challenge/ { root /var/www/certbot; } - location / { return 301 https://$host$request_uri; } + location / { + return 301 https://$host$request_uri; + } } + server { listen 443 ssl; server_name homaroma.shop www.homaroma.shop; + ssl_certificate /etc/letsencrypt/live/homaroma.shop/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/homaroma.shop/privkey.pem; + + # Next.js SSR location / { proxy_pass http://192.168.1.167:3002; + proxy_http_version 1.1; proxy_set_header Host $host; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; + 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; + proxy_cache_bypass $http_upgrade; + } + + # Next.js static assets caching + location /_next/static/ { + proxy_pass http://192.168.1.167:3002; + proxy_http_version 1.1; + proxy_set_header Host $host; + add_header Cache-Control "public, max-age=31536000, immutable"; } }