Files
Genarrative/deploy/nginx/snippets/genarrative-pingora-realpath-canary.conf
T
kdletters e9c3dc1120 退役旧创作模板业务
保留 SpacetimeDB 历史表、迁移白名单与旧业务源码
切换前端 active 入口并解除旧创作页面和路由编译链
移除旧后端路由、worker 与纯业务 crate 依赖
收敛 SpacetimeDB 模块为历史数据壳
同步 Nginx、Pingora、验证门禁与架构文档
2026-07-17 22:07:52 +08:00

91 lines
3.5 KiB
Plaintext

# Pingora real-path canary handoff server.
# 中文注释:本文件只提供人工 include 后的本机真实路径 canary,不默认承接公网流量。
# 启用前复制到目标机并替换 __GENARRATIVE_PINGORA_PROBE_TOKEN__,只能在 nginx http 上下文 include。
server {
listen 127.0.0.1:18083;
server_name genarrative-pingora-realpath-canary.local;
access_log /var/log/nginx/genarrative-pingora-realpath-canary.access.log genarrative_upstream;
error_log /var/log/nginx/genarrative-pingora-realpath-canary.error.log warn;
allow 127.0.0.1;
allow ::1;
deny all;
location = /__genarrative_pingora_realpath_canary/healthz {
proxy_http_version 1.1;
proxy_set_header Connection "";
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_set_header X-Forwarded-Host $host;
proxy_set_header X-Request-Id $request_id;
proxy_set_header X-Genarrative-Pingora-Probe "__GENARRATIVE_PINGORA_PROBE_TOKEN__";
add_header X-Genarrative-Nginx-Handoff pingora-realpath-canary always;
proxy_pass http://127.0.0.1:18081/__genarrative_pingora/healthz;
}
location = /api/assets/history {
default_type application/json;
proxy_http_version 1.1;
proxy_buffering off;
proxy_read_timeout 3600s;
proxy_send_timeout 3600s;
proxy_set_header Connection "";
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_set_header X-Forwarded-Host $host;
proxy_set_header X-Request-Id $request_id;
proxy_set_header X-Genarrative-Pingora-Canary "nginx-realpath";
add_header X-Accel-Buffering no always;
add_header X-Genarrative-Nginx-Handoff pingora-realpath-canary always;
proxy_pass http://127.0.0.1:18081;
}
location ~ ^/v1/database/[^/]+/subscribe$ {
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-Request-Id $request_id;
proxy_read_timeout 3600s;
add_header X-Genarrative-Nginx-Handoff pingora-realpath-canary always;
proxy_pass http://127.0.0.1:18081;
}
location ^~ /v1/identity {
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-Request-Id $request_id;
add_header X-Genarrative-Nginx-Handoff pingora-realpath-canary always;
proxy_pass http://127.0.0.1:18081;
}
location = /assets/app.js {
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_set_header Host $host;
proxy_set_header X-Request-Id $request_id;
add_header X-Genarrative-Nginx-Handoff pingora-realpath-canary always;
proxy_pass http://127.0.0.1:18081;
}
location = /generated-pingora-canary-smoke {
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_set_header Host $host;
proxy_set_header X-Request-Id $request_id;
add_header X-Genarrative-Nginx-Handoff pingora-realpath-canary always;
proxy_pass http://127.0.0.1:18081;
}
location / {
return 404;
}
}