Files
re-xxm/deploy/nginx/reaction-board.conf

26 lines
1.1 KiB
Plaintext
Raw Permalink 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.
# 站点反代:域名 → CDN → 公网 EIP → 本机 nginx → 127.0.0.1:8080(容器)。
#
# 配合 realip-*.conf(放在 http {} 内)先把真实客户端 IP 归一化到 $remote_addr,
# 再通过 X-Real-IP 传给容器。应用仅在 socket 对端属于可信代理网段时采信该头。
server {
listen 80;
server_name board.example.com; # TODO: 改成你的域名
# 回源 HTTP(CDN 侧终结 TLS)。若要 nginx 直接对公网提供 HTTPS,
# 另建 443 server 并配置证书,下列 proxy_set_header 保持不变。
client_max_body_size 1m;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr; # 归一化后的真实客户端 IP
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # 追加真实对端
proxy_set_header X-Forwarded-Proto $scheme;
location / {
proxy_pass http://127.0.0.1:8080;
}
# POST /api/visit(访问统计埋点)与其余只读接口走同一上游,无需额外配置。
}