8d78e18267
- Frontend: React 18 + TypeScript + Vite + Ant Design Mobile - Backend: PHP 8.5 + Webman 2.x + MySQL + Redis - i18n support: Chinese, English, Russian, Spanish, French - Approval workflow engine - Docker development environment - Feishu integration Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
49 lines
1.4 KiB
Plaintext
49 lines
1.4 KiB
Plaintext
server {
|
|
listen 80;
|
|
server_name api.x-server.local; # 本地测试域名
|
|
|
|
# API 反向代理
|
|
location /api/ {
|
|
proxy_pass http://127.0.0.1:8787/api/;
|
|
proxy_http_version 1.1;
|
|
|
|
# 传递真实IP
|
|
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;
|
|
|
|
# CORS 头部(用于开发调试)
|
|
add_header Access-Control-Allow-Origin *;
|
|
add_header Access-Control-Allow-Methods 'GET, POST, PUT, DELETE, OPTIONS';
|
|
add_header Access-Control-Allow-Headers 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization';
|
|
|
|
# 处理 OPTIONS 预检请求
|
|
if ($request_method = 'OPTIONS') {
|
|
return 204;
|
|
}
|
|
|
|
# 超时设置
|
|
proxy_connect_timeout 60s;
|
|
proxy_send_timeout 60s;
|
|
proxy_read_timeout 60s;
|
|
}
|
|
|
|
# 健康检查端点
|
|
location /health {
|
|
access_log off;
|
|
return 200 "healthy\n";
|
|
add_header Content-Type text/plain;
|
|
}
|
|
}
|
|
|
|
# HTTPS 配置(用于生产环境,需要配合 SSL 证书)
|
|
# server {
|
|
# listen 443 ssl http2;
|
|
# server_name api.x-server.com;
|
|
#
|
|
# ssl_certificate /path/to/cert.pem;
|
|
# ssl_certificate_key /path/to/key.pem;
|
|
#
|
|
# # ... 其他配置同上
|
|
# }
|