From 05fa686749ceb93cb7b4e2426fb09bd0db1b9948 Mon Sep 17 00:00:00 2001 From: lingyunxsh Date: Tue, 25 Aug 2026 20:20:54 +0800 Subject: [PATCH] init --- client/requirements.txt | 2 +- deploy/nginx.api.conf.example | 44 +++++++++++++++++++++++++++++++++++ server/requirements.txt | 2 +- 3 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 deploy/nginx.api.conf.example diff --git a/client/requirements.txt b/client/requirements.txt index b468b0d..1d7bc76 100644 --- a/client/requirements.txt +++ b/client/requirements.txt @@ -1,4 +1,4 @@ -# 客户端依赖 +# client dependencies fastapi>=0.111.0 uvicorn[standard]>=0.30.0 jinja2>=3.1.0 diff --git a/deploy/nginx.api.conf.example b/deploy/nginx.api.conf.example new file mode 100644 index 0000000..2872876 --- /dev/null +++ b/deploy/nginx.api.conf.example @@ -0,0 +1,44 @@ +# Nginx 反代配置示例(服务端 API) +# 使用方式: +# 1. 将本文件复制到 /etc/nginx/conf.d/jianli-api.conf +# 2. 把 api.example.com 替换为你的真实域名 +# 3. 证书路径按 certbot 实际生成位置调整(见 README) +# 4. nginx -t && systemctl reload nginx + +# HTTP 全部跳转 HTTPS +server { + listen 80; + server_name api.example.com; + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl; + http2 on; + server_name api.example.com; + + # Let's Encrypt 证书(certbot --nginx 会自动填写) + ssl_certificate /etc/letsencrypt/live/api.example.com/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/api.example.com/privkey.pem; + ssl_protocols TLSv1.2 TLSv1.3; + + # JD 全文归档 / 简历内容可能较大 + client_max_body_size 20m; + + # 访问日志(排查风控/异常调用用) + access_log /var/log/nginx/jianli-api.access.log; + + location / { + proxy_pass http://127.0.0.1:8000; + + proxy_set_header Host $host; + 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_connect_timeout 10s; + proxy_read_timeout 120s; + proxy_send_timeout 120s; + } +} diff --git a/server/requirements.txt b/server/requirements.txt index 4bb7905..37768ad 100644 --- a/server/requirements.txt +++ b/server/requirements.txt @@ -1,4 +1,4 @@ -# 服务端依赖 +# server dependencies fastapi>=0.111.0 uvicorn[standard]>=0.30.0 sqlalchemy>=2.0.30