x
This commit is contained in:
1 parent
7b857b4eda
commit
fc6bf0218e
2 files changed
+25
-4
No files matched your search
@@ -3,10 +3,12 @@
|
|||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const { PrismaClient } = require('@prisma/client');
|
const { PrismaClient } = require('@prisma/client');
|
||||||
|
const { Pool } = require('pg');
|
||||||
const { PrismaPg } = require('@prisma/adapter-pg');
|
const { PrismaPg } = require('@prisma/adapter-pg');
|
||||||
const bcrypt = require('bcryptjs');
|
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 prisma = new PrismaClient({ adapter });
|
||||||
|
|
||||||
const scentNames = [
|
const scentNames = [
|
||||||
|
|||||||
@@ -1,21 +1,40 @@
|
|||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
server_name homaroma.shop www.homaroma.shop;
|
server_name homaroma.shop www.homaroma.shop;
|
||||||
location ~ /.well-known/acme-challenge {
|
|
||||||
allow all;
|
location /.well-known/acme-challenge/ {
|
||||||
root /var/www/certbot;
|
root /var/www/certbot;
|
||||||
}
|
}
|
||||||
location / { return 301 https://$host$request_uri; }
|
location / {
|
||||||
|
return 301 https://$host$request_uri;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
server {
|
server {
|
||||||
listen 443 ssl;
|
listen 443 ssl;
|
||||||
server_name homaroma.shop www.homaroma.shop;
|
server_name homaroma.shop www.homaroma.shop;
|
||||||
|
|
||||||
ssl_certificate /etc/letsencrypt/live/homaroma.shop/fullchain.pem;
|
ssl_certificate /etc/letsencrypt/live/homaroma.shop/fullchain.pem;
|
||||||
ssl_certificate_key /etc/letsencrypt/live/homaroma.shop/privkey.pem;
|
ssl_certificate_key /etc/letsencrypt/live/homaroma.shop/privkey.pem;
|
||||||
|
|
||||||
|
# Next.js SSR
|
||||||
location / {
|
location / {
|
||||||
proxy_pass http://192.168.1.167:3002;
|
proxy_pass http://192.168.1.167:3002;
|
||||||
|
proxy_http_version 1.1;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
proxy_set_header Connection '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";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user