memoryweave/deploy/nginx-zhiyi.conf

61 lines
1.4 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# MemoryWeave (织忆) Nginx 反向代理配置
# 位置: /etc/nginx/sites-enabled/zhiyi.conf
# 端口: 7821 → 对外
upstream zhiyid {
# 主力机 primary
server 127.0.0.1:7821 max_fails=3 fail_timeout=30s;
# 局域网 replica可选
# server 192.168.123.x:7821 backup;
}
server {
listen 7821;
server_name localhost;
# 请求体大小限制 (batch-commit)
client_max_body_size 10M;
# 超时
proxy_read_timeout 300s; # 深度整合可能超过默认 60s
proxy_connect_timeout 10s;
proxy_send_timeout 60s;
# WebSocket 支持
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
# 通用代理头
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;
# 健康检查
location /health {
proxy_pass http://zhiyid/health;
access_log off;
}
# Admin 健康检查(含依赖检测)
location /health/full {
proxy_pass http://zhiyid/health/full;
access_log off;
}
# API
location /api/ {
proxy_pass http://zhiyid;
}
# Prometheus metrics (internal only)
location /metrics {
allow 127.0.0.1;
allow 192.168.0.0/16;
deny all;
proxy_pass http://zhiyid/metrics;
}
}