# /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@:/etc/nginx/conf.d/ # ssh root@ '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; } }