From 4b4ebdec62ac316dbdd1b40d000563687a12170d Mon Sep 17 00:00:00 2001 From: leiyun Date: Fri, 20 Mar 2026 23:12:37 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E4=BF=AE=E6=94=B9=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nginx.conf | 30 ++++++++++++++++++++++-------- src/config/adapter.js | 6 +++--- src/config/adapter.production.js | 4 ++-- 3 files changed, 27 insertions(+), 13 deletions(-) diff --git a/nginx.conf b/nginx.conf index 7a0ea9f..00254ec 100644 --- a/nginx.conf +++ b/nginx.conf @@ -1,19 +1,32 @@ # HTTP -> HTTPS 强制跳转 server { listen 80; - server_name wk.aionline.cc; - return 301 https://$host$request_uri; + server_name cytx.csybhelp.com; + # ACME HTTP-01 验证路径放行 + location /.well-known/acme-challenge/ { + root /home/acme-challenge; + } + + # HTTP 跳转 HTTPS + location / { + rewrite ^(.*)$ https://$server_name$1 permanent; + } + } # HTTPS server { listen 443 ssl; http2 on; - server_name wk.aionline.cc; - root /home/www/pap_web/www; + server_name cytx.csybhelp.com; + root /home/www/cytx_api; + + access_log /home/wwwlogs/cytx_api_access.log; + error_log /home/wwwlogs/cytx_api_error.log; + - ssl_certificate /etc/nginx/ssl/wk.aionline.cc.pem; - ssl_certificate_key /etc/nginx/ssl/wk.aionline.cc.key; + ssl_certificate cert/cytx_csybhelp_com_fullchain.pem; + ssl_certificate_key cert/cytx_csybhelp_com_privkey.pem; ssl_protocols TLSv1.2 TLSv1.3; ssl_ciphers HIGH:!aNULL:!MD5; @@ -22,14 +35,15 @@ server { index index.js index.html index.htm; # 静态资源直接返回,长缓存 - location ~ /static/ { + location /static/ { + root /home/www/cytx_api/www; etag on; expires max; } # 上传文件目录 location /upload/ { - alias /home/www/pap_web/www/upload/; + alias /home/www/cytx_api/www/upload/; etag on; expires 7d; } diff --git a/src/config/adapter.js b/src/config/adapter.js index 34a5421..ae0a819 100644 --- a/src/config/adapter.js +++ b/src/config/adapter.js @@ -30,8 +30,8 @@ exports.cache = { exports.model = { type: 'pap', common: { - logConnect: isDev, - logSql: isDev, + logConnect: true, + logSql: true, logger: msg => think.logger.info(msg) }, // pap 测试数据库 @@ -90,7 +90,7 @@ exports.view = { * @type {Object} */ exports.logger = { - type: isDev ? 'console' : 'dateFile', + type: 'console', console: { handle: Console }, diff --git a/src/config/adapter.production.js b/src/config/adapter.production.js index ae478e1..94a3974 100644 --- a/src/config/adapter.production.js +++ b/src/config/adapter.production.js @@ -27,8 +27,8 @@ exports.cache = { exports.model = { type: 'pap', common: { - logConnect: false, - logSql: false, + logConnect: true, + logSql: true, logger: msg => think.logger.info(msg) }, // pap 线上数据库