diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e8caf18 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,31 @@ +# 使用Node.js 20作为基础镜像 +FROM node:20-alpine + +# 设置工作目录 +WORKDIR /app + +# 安装PM2全局 +RUN npm install -g pm2 + +# 安装pnpm +RUN npm install -g pnpm + +# 复制项目文件 +COPY . . + +# 安装项目依赖 +RUN npm install . + +# 创建logs目录 +RUN mkdir -p logs + +# 暴露端口(根据pm2配置,需要暴露51703-51708端口) +EXPOSE 51703 51704 51705 51706 51707 51708 + +# 设置环境变量 +ENV NODE_ENV=production +RUN chmod 777 ./start.sh + +# CMD ["npm", "run", "start:pm2:multi"] +# 启动命令 - 使用tail阻塞容器 +CMD ["./start.sh"] \ No newline at end of file diff --git a/app/config/api-config.ts b/app/config/api-config.ts index fa5cbef..0b0999a 100644 --- a/app/config/api-config.ts +++ b/app/config/api-config.ts @@ -71,46 +71,48 @@ const portConfigs: Record> = { // 主要 + // 梅州 '51703': { - baseUrl: 'http://172.16.0.55:51703', - documentUrl: 'http://172.16.0.55:51703/docauditai/', - uploadUrl: 'http://172.16.0.55:51703/admin/documents' + baseUrl: 'http://10.79.97.17:8000', + documentUrl: 'http://10.79.97.17:8000/docauditai/', + uploadUrl: 'http://10.79.97.17:8000/admin/documents' }, - // 潮州 + + // 云浮 '51704': { - baseUrl: 'http://172.16.0.55:51704', - documentUrl: 'http://172.16.0.55:51704/docauditai/', - uploadUrl: 'http://172.16.0.55:51704/admin/documents' + baseUrl: 'http://10.79.97.17:8001', + documentUrl: 'http://10.79.97.17:8001/docauditai/', + uploadUrl: 'http://10.79.97.17:8001/admin/documents' }, // 揭阳 '51705': { - baseUrl: 'http://172.16.0.55:51705', - documentUrl: 'http://172.16.0.55:51705/docauditai/', - uploadUrl: 'http://172.16.0.55:51705/admin/documents' + baseUrl: 'http://10.79.97.17:8002', + documentUrl: 'http://10.79.97.17:8002/docauditai/', + uploadUrl: 'http://10.79.97.17:8002/admin/documents' }, - // 云浮 + // 潮州 '51706': { - baseUrl: 'http://172.16.0.55:51706', - documentUrl: 'http://172.16.0.55:51706/docauditai/', - uploadUrl: 'http://172.16.0.55:51706/admin/documents' + baseUrl: 'http://10.79.97.17:8003', + documentUrl: 'http://10.79.97.17:8003/docauditai/', + uploadUrl: 'http://10.79.97.17:8003/admin/documents' }, - // 梅州 - '51707': { - baseUrl: 'http://172.16.0.55:51707', - documentUrl: 'http://172.16.0.55:51707/docauditai/', - uploadUrl: 'http://172.16.0.55:51707/admin/documents' - }, // 省局 + '51707': { + baseUrl: 'http://10.79.97.17:8004', + documentUrl: 'http://10.79.97.17:8004/docauditai/', + uploadUrl: 'http://10.79.97.17:8004/admin/documents' + }, + //test '51708': { - baseUrl: 'http://172.16.0.55:51708', - documentUrl: 'http://172.16.0.55:51708/docauditai/', - uploadUrl: 'http://172.16.0.55:51708/admin/documents' - } + baseUrl: 'http://10.79.97.17:8005', + documentUrl: 'http://10.79.97.17:8005/docauditai/', + uploadUrl: 'http://10.79.97.17:8005/admin/documents' + }, }; // 不同环境的默认配置 diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..0307234 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,37 @@ +services: + docreview: + build: . + container_name: docreview-app + ports: + - "51703:51703" # 主服务 + - "51704:51704" # 潮州客户端 + - "51705:51705" # 揭阳客户端 + - "51706:51706" # 云浮客户端 + - "51707:51707" # 梅州客户端 + - "51708:51708" # 省局客户端 + environment: + - NODE_ENV=production + volumes: + - .:/app # 挂载整个项目目录 + - /app/node_modules # 排除node_modules,使用容器内的 + restart: unless-stopped + networks: + - docreview-network + depends_on: + - nginx + + nginx: + image: nginx:alpine + container_name: docreview-nginx + ports: + - "8080:80" + - "443:443" + volumes: + - ./nginx/conf.d:/etc/nginx/conf.d/:ro + restart: unless-stopped + networks: + - docreview-network + +networks: + docreview-network: + driver: bridge \ No newline at end of file diff --git a/ecosystem.config.cjs b/ecosystem.config.cjs index b6a6258..e0eadaf 100644 --- a/ecosystem.config.cjs +++ b/ecosystem.config.cjs @@ -4,8 +4,9 @@ module.exports = { apps: [ // 主服务 - 生产环境 (端口: 51703) + // 梅州 { - name: 'docreview-main', + name: 'docreview-main-meizhou', script: 'node', args: [ '-r', 'dotenv/config', @@ -21,23 +22,23 @@ module.exports = { env: { NODE_ENV: 'production', PORT: 51703, - CLIENT_ID: 'main', + CLIENT_ID: 'meizhou', API_PORT_CONFIG: '51703', // 添加这些环境变量确保客户端能获取到 NEXT_PUBLIC_NODE_ENV: 'production', NEXT_PUBLIC_PORT: '51703', - NEXT_PUBLIC_CLIENT_ID: 'main', + NEXT_PUBLIC_CLIENT_ID: 'meizhou', NEXT_PUBLIC_API_PORT_CONFIG: '51703' }, - error_file: './logs/main-err.log', - out_file: './logs/main-out.log', - log_file: './logs/main-combined.log', + error_file: './logs/meizhou-err.log', + out_file: './logs/meizhou-out.log', + log_file: './logs/meizhou-combined.log', time: true }, - // 客户端潮州 - 反向代理服务 (端口: 51704) + // 客户端云浮 - 反向代理服务 (端口: 51704) { - name: 'docreview-client-chaozhou', + name: 'docreview-client-yunfu', script: 'node', args: [ '-r', 'dotenv/config', @@ -53,17 +54,17 @@ module.exports = { env: { NODE_ENV: 'production', PORT: 51704, - CLIENT_ID: 'chaozhou', + CLIENT_ID: 'yunfu', API_PORT_CONFIG: '51704', // 添加这些环境变量确保客户端能获取到 NEXT_PUBLIC_NODE_ENV: 'production', NEXT_PUBLIC_PORT: '51704', - NEXT_PUBLIC_CLIENT_ID: 'chaozhou', + NEXT_PUBLIC_CLIENT_ID: 'yunfu', NEXT_PUBLIC_API_PORT_CONFIG: '51704' }, - error_file: './logs/chaozhou-err.log', - out_file: './logs/chaozhou-out.log', - log_file: './logs/chaozhou-combined.log', + error_file: './logs/yunfu-err.log', + out_file: './logs/yunfu-out.log', + log_file: './logs/yunfu-combined.log', time: true }, // 客户端揭阳 - 独立服务 (端口: 51705) @@ -97,9 +98,9 @@ module.exports = { log_file: './logs/jieyang-combined.log', time: true }, - // 客户端云浮 - 独立服务 (端口: 51706) + // 客户端潮州 - 独立服务 (端口: 51706) { - name: 'docreview-client-yunfu', + name: 'docreview-client-chaozhou', script: 'node', args: [ '-r', 'dotenv/config', @@ -115,22 +116,22 @@ module.exports = { env: { NODE_ENV: 'production', PORT: 51706, - CLIENT_ID: 'yunfu', + CLIENT_ID: 'chaozhou', API_PORT_CONFIG: '51706', // 添加这些环境变量确保客户端能获取到 NEXT_PUBLIC_NODE_ENV: 'production', NEXT_PUBLIC_PORT: '51706', - NEXT_PUBLIC_CLIENT_ID: 'yunfu', + NEXT_PUBLIC_CLIENT_ID: 'chaozhou', NEXT_PUBLIC_API_PORT_CONFIG: '51706' }, - error_file: './logs/yunfu-err.log', - out_file: './logs/yunfu-out.log', - log_file: './logs/yunfu-combined.log', + error_file: './logs/chaozhou-err.log', + out_file: './logs/chaozhou-out.log', + log_file: './logs/chaozhou-combined.log', time: true }, - // 客户端梅州 - 独立服务 (端口: 51707) + // 客户端省局 - 独立服务 (端口: 51707) { - name: 'docreview-client-meizhou', + name: 'docreview-client-province', script: 'node', args: [ '-r', 'dotenv/config', @@ -146,49 +147,49 @@ module.exports = { env: { NODE_ENV: 'production', PORT: 51707, - CLIENT_ID: 'meizhou', + CLIENT_ID: 'province', API_PORT_CONFIG: '51707', // 添加这些环境变量确保客户端能获取到 NEXT_PUBLIC_NODE_ENV: 'production', NEXT_PUBLIC_PORT: '51707', - NEXT_PUBLIC_CLIENT_ID: 'meizhou', - NEXT_PUBLIC_API_PORT_CONFIG: '51707' - }, - error_file: './logs/meizhou-err.log', - out_file: './logs/meizhou-out.log', - log_file: './logs/meizhou-combined.log', - time: true - }, - // 客户端省局 - 独立服务 (端口: 51708) - { - name: 'docreview-client-province', - script: 'node', - args: [ - '-r', 'dotenv/config', - //'./node_modules/.bin/remix-serve', - './node_modules/@remix-run/serve/dist/cli.js', - './build/server/index.js', - '--port', '51708' - ], - instances: 1, - autorestart: true, - watch: false, - max_memory_restart: '1G', - env: { - NODE_ENV: 'production', - PORT: 51708, - CLIENT_ID: 'province', - API_PORT_CONFIG: '51708', - // 添加这些环境变量确保客户端能获取到 - NEXT_PUBLIC_NODE_ENV: 'production', - NEXT_PUBLIC_PORT: '51708', NEXT_PUBLIC_CLIENT_ID: 'province', - NEXT_PUBLIC_API_PORT_CONFIG: '51708' + NEXT_PUBLIC_API_PORT_CONFIG: '51707' }, error_file: './logs/province-err.log', out_file: './logs/province-out.log', log_file: './logs/province-combined.log', time: true - } + }, + // 客户端省局 - 独立服务 (端口: 51708) + // { + // name: 'docreview-client-province', + // script: 'node', + // args: [ + // '-r', 'dotenv/config', + // //'./node_modules/.bin/remix-serve', + // './node_modules/@remix-run/serve/dist/cli.js', + // './build/server/index.js', + // '--port', '51708' + // ], + // instances: 1, + // autorestart: true, + // watch: false, + // max_memory_restart: '1G', + // env: { + // NODE_ENV: 'production', + // PORT: 51708, + // CLIENT_ID: 'province', + // API_PORT_CONFIG: '51708', + // // 添加这些环境变量确保客户端能获取到 + // NEXT_PUBLIC_NODE_ENV: 'production', + // NEXT_PUBLIC_PORT: '51708', + // NEXT_PUBLIC_CLIENT_ID: 'province', + // NEXT_PUBLIC_API_PORT_CONFIG: '51708' + // }, + // error_file: './logs/province-err.log', + // out_file: './logs/province-out.log', + // log_file: './logs/province-combined.log', + // time: true + // } ], }; \ No newline at end of file diff --git a/ecosystemDev.config.cjs b/ecosystemDev.config.cjs index d87624a..dbd125c 100644 --- a/ecosystemDev.config.cjs +++ b/ecosystemDev.config.cjs @@ -3,7 +3,7 @@ module.exports = { apps: [ - // 主服务 - 生产环境 (端口: 5173) + // 主服务 - 生产环境 (端口: 51703) { name: 'docreview-main', script: 'node', @@ -12,7 +12,7 @@ module.exports = { // './node_modules/.bin/remix-serve', './node_modules/@remix-run/serve/dist/cli.js', './build/server/index.js', - '--port', '5173' + '--port', '51703' ], instances: 1, autorestart: true, @@ -20,26 +20,26 @@ module.exports = { max_memory_restart: '1G', env: { NODE_ENV: 'testing', - PORT: 5173, + PORT: 51703, CLIENT_ID: 'main', - API_PORT_CONFIG: '5173', + API_PORT_CONFIG: '51703', // 添加这些环境变量确保客户端能获取到 NEXT_PUBLIC_NODE_ENV: 'testing', - NEXT_PUBLIC_PORT: '5173', + NEXT_PUBLIC_PORT: '51703', NEXT_PUBLIC_CLIENT_ID: 'main', - NEXT_PUBLIC_API_PORT_CONFIG: '5173', - // REMIX_DEV_ORIGIN: 'http://localhost:5173' + NEXT_PUBLIC_API_PORT_CONFIG: '51703', + // REMIX_DEV_ORIGIN: 'http://localhost:51703' }, env_testing: { NODE_ENV: 'testing', - PORT: 5173, + PORT: 51703, CLIENT_ID: 'main', - API_PORT_CONFIG: '5173', + API_PORT_CONFIG: '51703', // 添加这些环境变量确保客户端能获取到 NEXT_PUBLIC_NODE_ENV: 'testing', - NEXT_PUBLIC_PORT: '5173', + NEXT_PUBLIC_PORT: '51703', NEXT_PUBLIC_CLIENT_ID: 'main', - NEXT_PUBLIC_API_PORT_CONFIG: '5173' + NEXT_PUBLIC_API_PORT_CONFIG: '51703' }, error_file: './logs/main-err.log', out_file: './logs/main-out.log', @@ -47,7 +47,7 @@ module.exports = { time: true }, - // 客户端潮州 - 反向代理服务 (端口: 5174) + // 客户端潮州 - 反向代理服务 (端口: 51704) { name: 'docreview-client-chaozhou', script: 'node', @@ -56,7 +56,7 @@ module.exports = { // './node_modules/.bin/remix-serve', './node_modules/@remix-run/serve/dist/cli.js', './build/server/index.js', - '--port', '5174' + '--port', '51704' ], instances: 1, autorestart: true, @@ -64,33 +64,33 @@ module.exports = { max_memory_restart: '1G', env: { NODE_ENV: 'testing', - PORT: 5174, + PORT: 51704, CLIENT_ID: 'chaozhou', - API_PORT_CONFIG: '5174', + API_PORT_CONFIG: '51704', // 添加这些环境变量确保客户端能获取到 NEXT_PUBLIC_NODE_ENV: 'testing', - NEXT_PUBLIC_PORT: '5174', + NEXT_PUBLIC_PORT: '51704', NEXT_PUBLIC_CLIENT_ID: 'chaozhou', - NEXT_PUBLIC_API_PORT_CONFIG: '5174', - // REMIX_DEV_ORIGIN: 'http://localhost:5174' + NEXT_PUBLIC_API_PORT_CONFIG: '51704', + // REMIX_DEV_ORIGIN: 'http://localhost:51704' }, env_testing: { NODE_ENV: 'testing', - PORT: 5174, + PORT: 51704, CLIENT_ID: 'chaozhou', - API_PORT_CONFIG: '5174', + API_PORT_CONFIG: '51704', // 添加这些环境变量确保客户端能获取到 NEXT_PUBLIC_NODE_ENV: 'testing', - NEXT_PUBLIC_PORT: '5174', + NEXT_PUBLIC_PORT: '51704', NEXT_PUBLIC_CLIENT_ID: 'chaozhou', - NEXT_PUBLIC_API_PORT_CONFIG: '5174' + NEXT_PUBLIC_API_PORT_CONFIG: '51704' }, error_file: './logs/chaozhou-err.log', out_file: './logs/chaozhou-out.log', log_file: './logs/chaozhou-combined.log', time: true }, - // 客户端揭阳 - 独立服务 (端口: 5175) + // 客户端揭阳 - 独立服务 (端口: 51705) { name: 'docreview-client-jieyang', script: 'node', @@ -99,7 +99,7 @@ module.exports = { // './node_modules/.bin/remix-serve', './node_modules/@remix-run/serve/dist/cli.js', './build/server/index.js', - '--port', '5175' + '--port', '51705' ], instances: 1, autorestart: true, @@ -107,33 +107,33 @@ module.exports = { max_memory_restart: '1G', env: { NODE_ENV: 'testing', - PORT: 5175, + PORT: 51705, CLIENT_ID: 'jieyang', - API_PORT_CONFIG: '5175', + API_PORT_CONFIG: '51705', // 添加这些环境变量确保客户端能获取到 NEXT_PUBLIC_NODE_ENV: 'testing', - NEXT_PUBLIC_PORT: '5175', + NEXT_PUBLIC_PORT: '51705', NEXT_PUBLIC_CLIENT_ID: 'jieyang', - NEXT_PUBLIC_API_PORT_CONFIG: '5175', - // REMIX_DEV_ORIGIN: 'http://localhost:5175' + NEXT_PUBLIC_API_PORT_CONFIG: '51705', + // REMIX_DEV_ORIGIN: 'http://localhost:51705' }, env_testing: { NODE_ENV: 'testing', - PORT: 5175, + PORT: 51705, CLIENT_ID: 'jieyang', - API_PORT_CONFIG: '5175', + API_PORT_CONFIG: '51705', // 添加这些环境变量确保客户端能获取到 NEXT_PUBLIC_NODE_ENV: 'testing', - NEXT_PUBLIC_PORT: '5175', + NEXT_PUBLIC_PORT: '51705', NEXT_PUBLIC_CLIENT_ID: 'jieyang', - NEXT_PUBLIC_API_PORT_CONFIG: '5175' + NEXT_PUBLIC_API_PORT_CONFIG: '51705' }, error_file: './logs/jieyang-err.log', out_file: './logs/jieyang-out.log', log_file: './logs/jieyang-combined.log', time: true }, - // 客户端云浮 - 独立服务 (端口: 5176) + // 客户端云浮 - 独立服务 (端口: 51706) { name: 'docreview-client-yunfu', script: 'node', @@ -142,7 +142,7 @@ module.exports = { // './node_modules/.bin/remix-serve', './node_modules/@remix-run/serve/dist/cli.js', './build/server/index.js', - '--port', '5176' + '--port', '51706' ], instances: 1, autorestart: true, @@ -150,33 +150,33 @@ module.exports = { max_memory_restart: '1G', env: { NODE_ENV: 'testing', - PORT: 5176, + PORT: 51706, CLIENT_ID: 'yunfu', - API_PORT_CONFIG: '5176', + API_PORT_CONFIG: '51706', // 添加这些环境变量确保客户端能获取到 NEXT_PUBLIC_NODE_ENV: 'testing', - NEXT_PUBLIC_PORT: '5176', + NEXT_PUBLIC_PORT: '51706', NEXT_PUBLIC_CLIENT_ID: 'yunfu', - NEXT_PUBLIC_API_PORT_CONFIG: '5176', - // REMIX_DEV_ORIGIN: 'http://localhost:5176' + NEXT_PUBLIC_API_PORT_CONFIG: '51706', + // REMIX_DEV_ORIGIN: 'http://localhost:51706' }, env_testing: { NODE_ENV: 'testing', - PORT: 5176, + PORT: 51706, CLIENT_ID: 'yunfu', - API_PORT_CONFIG: '5176', + API_PORT_CONFIG: '51706', // 添加这些环境变量确保客户端能获取到 NEXT_PUBLIC_NODE_ENV: 'testing', - NEXT_PUBLIC_PORT: '5176', + NEXT_PUBLIC_PORT: '51706', NEXT_PUBLIC_CLIENT_ID: 'yunfu', - NEXT_PUBLIC_API_PORT_CONFIG: '5176' + NEXT_PUBLIC_API_PORT_CONFIG: '51706' }, error_file: './logs/yunfu-err.log', out_file: './logs/yunfu-out.log', log_file: './logs/yunfu-combined.log', time: true }, - // 客户端梅州 - 独立服务 (端口: 5177) + // 客户端梅州 - 独立服务 (端口: 51707) { name: 'docreview-client-meizhou', script: 'node', @@ -185,7 +185,7 @@ module.exports = { //'./node_modules/.bin/remix-serve', './node_modules/@remix-run/serve/dist/cli.js', './build/server/index.js', - '--port', '5177' + '--port', '51707' ], instances: 1, autorestart: true, @@ -193,33 +193,33 @@ module.exports = { max_memory_restart: '1G', env: { NODE_ENV: 'testing', - PORT: 5177, + PORT: 51707, CLIENT_ID: 'meizhou', - API_PORT_CONFIG: '5177', + API_PORT_CONFIG: '51707', // 添加这些环境变量确保客户端能获取到 NEXT_PUBLIC_NODE_ENV: 'testing', - NEXT_PUBLIC_PORT: '5177', + NEXT_PUBLIC_PORT: '51707', NEXT_PUBLIC_CLIENT_ID: 'meizhou', - NEXT_PUBLIC_API_PORT_CONFIG: '5177', - // REMIX_DEV_ORIGIN: 'http://localhost:5177' + NEXT_PUBLIC_API_PORT_CONFIG: '51707', + // REMIX_DEV_ORIGIN: 'http://localhost:51707' }, env_testing: { NODE_ENV: 'testing', - PORT: 5177, + PORT: 51707, CLIENT_ID: 'meizhou', - API_PORT_CONFIG: '5177', + API_PORT_CONFIG: '51707', // 添加这些环境变量确保客户端能获取到 NEXT_PUBLIC_NODE_ENV: 'testing', - NEXT_PUBLIC_PORT: '5177', + NEXT_PUBLIC_PORT: '51707', NEXT_PUBLIC_CLIENT_ID: 'meizhou', - NEXT_PUBLIC_API_PORT_CONFIG: '5177' + NEXT_PUBLIC_API_PORT_CONFIG: '51707' }, error_file: './logs/meizhou-err.log', out_file: './logs/meizhou-out.log', log_file: './logs/meizhou-combined.log', time: true }, - // 客户端省局 - 独立服务 (端口: 5178) + // 客户端省局 - 独立服务 (端口: 51708) { name: 'docreview-client-province', script: 'node', @@ -228,7 +228,7 @@ module.exports = { //'./node_modules/.bin/remix-serve', './node_modules/@remix-run/serve/dist/cli.js', './build/server/index.js', - '--port', '5178' + '--port', '51708' ], instances: 1, autorestart: true, @@ -236,26 +236,26 @@ module.exports = { max_memory_restart: '1G', env: { NODE_ENV: 'testing', - PORT: 5178, + PORT: 51708, CLIENT_ID: 'province', - API_PORT_CONFIG: '5178', + API_PORT_CONFIG: '51708', // 添加这些环境变量确保客户端能获取到 NEXT_PUBLIC_NODE_ENV: 'testing', - NEXT_PUBLIC_PORT: '5178', + NEXT_PUBLIC_PORT: '51708', NEXT_PUBLIC_CLIENT_ID: 'province', - NEXT_PUBLIC_API_PORT_CONFIG: '5178', - // REMIX_DEV_ORIGIN: 'http://localhost:5178' + NEXT_PUBLIC_API_PORT_CONFIG: '51708', + // REMIX_DEV_ORIGIN: 'http://localhost:51708' }, env_testing: { NODE_ENV: 'testing', - PORT: 5178, + PORT: 51708, CLIENT_ID: 'province', - API_PORT_CONFIG: '5178', + API_PORT_CONFIG: '51708', // 添加这些环境变量确保客户端能获取到 NEXT_PUBLIC_NODE_ENV: 'testing', - NEXT_PUBLIC_PORT: '5178', + NEXT_PUBLIC_PORT: '51708', NEXT_PUBLIC_CLIENT_ID: 'province', - NEXT_PUBLIC_API_PORT_CONFIG: '5178' + NEXT_PUBLIC_API_PORT_CONFIG: '51708' }, error_file: './logs/province-err.log', out_file: './logs/province-out.log', diff --git a/nginx.conf b/nginx/conf.d/app.conf similarity index 87% rename from nginx.conf rename to nginx/conf.d/app.conf index c24ff22..a61da9c 100644 --- a/nginx.conf +++ b/nginx/conf.d/app.conf @@ -1,5 +1,4 @@ -# 基于 state 参数端口分发的 OAuth2 回调 Nginx 配置 -# 只保留回调分发相关配置,其他内容全部删除 +# 基于 state 参数端口分发的 OAuth2 回调配置 # 1. 端口白名单映射(只允许指定端口) map $arg_state $target_port { @@ -30,4 +29,4 @@ server { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } -} \ No newline at end of file +} \ No newline at end of file diff --git a/nginx/nginx.conf b/nginx/nginx.conf new file mode 100644 index 0000000..d5675fc --- /dev/null +++ b/nginx/nginx.conf @@ -0,0 +1,28 @@ +user nginx; +worker_processes auto; +error_log /var/log/nginx/error.log notice; +pid /var/run/nginx.pid; + +events { + worker_connections 1024; +} + +http { + include /etc/nginx/mime.types; + default_type application/octet-stream; + + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for"'; + + access_log /var/log/nginx/access.log main; + + sendfile on; + tcp_nopush on; + tcp_nodelay on; + keepalive_timeout 65; + types_hash_max_size 2048; + + # 包含conf.d目录中的配置文件 + include /etc/nginx/conf.d/*.conf; +} \ No newline at end of file diff --git a/start.sh b/start.sh new file mode 100644 index 0000000..2587088 --- /dev/null +++ b/start.sh @@ -0,0 +1 @@ +npm run start:pm2:multi && tail -f /dev/null \ No newline at end of file