From e37e8dc9f20741757028fea7a47b1ae9d46f0bea Mon Sep 17 00:00:00 2001 From: dxin Date: Mon, 3 Nov 2025 09:25:08 +0800 Subject: [PATCH] 1 --- nginx/apex_web.conf | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 nginx/apex_web.conf diff --git a/nginx/apex_web.conf b/nginx/apex_web.conf new file mode 100644 index 0000000..0564f1d --- /dev/null +++ b/nginx/apex_web.conf @@ -0,0 +1,38 @@ +log_format apex_log '客户端IP: $remote_addr | 用户: $remote_user | 时间: $time_local | ' + '请求方法和路径: "$request" | 状态码: $status | 响应大小: $body_bytes_sent | ' + '来源页面: "$http_referer" | 客户端UA: "$http_user_agent" | ' + '上游服务器: $upstream_addr | 上游响应耗时: $upstream_response_time | ' + '请求总耗时: $request_time | Host: $host'; + +server { + listen 443 ssl; + server_name 127.0.0.1; + + ssl_certificate /data/tengine/conf/certificate/apex.deeplink.media_bundle.crt; + ssl_certificate_key /data/tengine/conf/certificate/apex.deeplink.media.key; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + + # 单独日志文件 + access_log /data/tengine/logs/apex_access.log apex_log; + error_log /data/tengine/logs/apex_error.log; + + # 前端静态文件 + location / { + root /data/tengine/html/apex_web/dist; + index index.html; + try_files $uri $uri/ /index.html; + } + + # 缓存控制,确保 JS 文件不缓存老内容 + location ~* \.(js|css|woff2|json|svg)$ { + root /data/tengine/html/apex_web/dist; + add_header Cache-Control "no-cache, no-store, must-revalidate"; + } + + # 错误页面 + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /data/tengine/html/apex_web/dist; + } +} \ No newline at end of file