docs(deploy): document PV/UV stats and real client IP via nginx realip
This commit is contained in:
1 parent
b215f8eb09
commit
ff5e05998a
11 files changed
+308
-6
No files matched your search
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
# 由 EdgeOne 节点 CIDR 清单生成 realip 配置,供 realip-edgeone.conf 使用。
|
||||
#
|
||||
# EdgeOne 节点网段会变动,需从 EdgeOne 控制台或 API 导出为「每行一个 CIDR」
|
||||
# 的清单后传入本脚本(不硬编码易过期的网段)。
|
||||
#
|
||||
# 用法: sudo bash deploy/nginx/update-edgeone-ips.sh <cidr-list-file> [输出文件]
|
||||
# 默认输出: /etc/nginx/edgeone-ips.conf
|
||||
set -euo pipefail
|
||||
|
||||
SOURCE="${1:?用法: update-edgeone-ips.sh <cidr-list-file> [输出文件]}"
|
||||
OUT="${2:-/etc/nginx/edgeone-ips.conf}"
|
||||
|
||||
sed '/^[[:space:]]*#/d; /^[[:space:]]*$/d; s|^|set_real_ip_from |; s|$|;|' "$SOURCE" > "${OUT}.tmp"
|
||||
mv "${OUT}.tmp" "$OUT"
|
||||
echo "已写入 $OUT"
|
||||
|
||||
if command -v nginx >/dev/null 2>&1; then
|
||||
nginx -t && nginx -s reload
|
||||
fi
|
||||
Reference in new issue
Block a user