- 新增 advitise v2: info/location/bind/click-stat/day-click-stat 模型与 对应的 service、api、router、proto 定义 - models/index.go 注册 5 个新模型的索引初始化 - 鉴权白名单: /rsdownload/ 改为 /download/,放行 advitise v2 的 get/click 接口 - statg/config: proxyUrl 增加 fileRes1 - common/genId: lid 生成逻辑补充 - 新增 91fans / huangguo 的 mobileconfig 描述文件 - 新增 deploy/nginx/cpcdownload.mfcg.me.conf 网关配置 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
59 lines
2.0 KiB
Plaintext
59 lines
2.0 KiB
Plaintext
# /etc/nginx/conf.d/cpcdownload.mfcg.me.conf
|
|
#
|
|
# cpcdownload.mfcg.me -> stat_center Go 服务 (127.0.0.1:8089)
|
|
# 用途:
|
|
# - GET /download/{appId}/{channel} 双端下载落地页(ios 返回 mobileconfig / android 302 跳转)
|
|
# - POST /api/stat/cpc/download/{list,add,update,del} 后台 CPC 下载配置管理
|
|
#
|
|
# 部署:
|
|
# scp deploy/nginx/cpcdownload.mfcg.me.conf root@<gateway>:/etc/nginx/conf.d/
|
|
# ssh root@<gateway> 'nginx -t && nginx -s reload'
|
|
|
|
# HTTP -> HTTPS
|
|
server {
|
|
listen 80;
|
|
listen [::]:80;
|
|
server_name cpcdownload.mfcg.me;
|
|
return 301 https://$host$request_uri;
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl http2;
|
|
listen [::]:443 ssl http2;
|
|
server_name cpcdownload.mfcg.me;
|
|
|
|
# 证书路径按你机器上的实际位置调整(沿用同 mfcg.me 通配证书即可)
|
|
ssl_certificate /etc/nginx/ssl/mfcg.me/fullchain.pem;
|
|
ssl_certificate_key /etc/nginx/ssl/mfcg.me/privkey.pem;
|
|
|
|
ssl_protocols TLSv1.2 TLSv1.3;
|
|
ssl_ciphers HIGH:!aNULL:!MD5;
|
|
ssl_session_cache shared:SSL:10m;
|
|
ssl_session_timeout 10m;
|
|
|
|
access_log /var/log/nginx/cpcdownload.mfcg.me.access.log;
|
|
error_log /var/log/nginx/cpcdownload.mfcg.me.error.log;
|
|
|
|
# mobileconfig 大小通常很小,这里放宽到 8M 兜底
|
|
client_max_body_size 8m;
|
|
|
|
location / {
|
|
proxy_pass http://127.0.0.1:8089;
|
|
proxy_http_version 1.1;
|
|
|
|
# 透传真实 IP(后端 ctx.ClientIP() 依赖此头取 IP 入库 landingpage_cpc)
|
|
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;
|
|
|
|
# mobileconfig 是二进制,保持原样;不做缓冲以便 302 立即下发
|
|
proxy_buffering off;
|
|
proxy_request_buffering off;
|
|
|
|
proxy_connect_timeout 5s;
|
|
proxy_send_timeout 30s;
|
|
proxy_read_timeout 30s;
|
|
}
|
|
}
|