Files
adcloud-server/deploy/nginx.conf.example
T
codex-bot 0fc6c68a99 Implement identity graph stitching and configurable profile storage
Issue persistent signed anonymous IDs and accept cookie/token-bound events.
Resolve verified email, phone, OAuth, and namespaced third-party IDs into
transactionally merged master identities with historical event aliases.
Protect shared-device account switching, tenant isolation, and event retries.

Store sparse canonical profiles as PostgreSQL JSONB or local SQLite JSON.
Support an optional versioned Cassandra wide-column projection through a
transactional outbox, retry worker, and immediate canonical read fallback.
Document deployment settings and provide opt-in database integration tests.

Validation: 43 local tests passed; 6 external database tests skipped.
Ruff checks, formatting, and offline uv lock verification passed.
2026-09-15 23:49:43 +08:00

45 lines
1.9 KiB
Plaintext

# Include this file inside the nginx http {} block.
# Replace server_name and certificate paths before deployment.
# All domains currently run in one modular FastAPI process.
upstream adcloud_events { server 127.0.0.1:8000; }
upstream adcloud_users { server 127.0.0.1:8000; }
upstream adcloud_ads { server 127.0.0.1:8000; }
upstream adcloud_identity { server 127.0.0.1:8000; }
upstream adcloud_api { server 127.0.0.1:8000; }
server {
listen 443 ssl;
server_name api.adcloud.example;
ssl_certificate /etc/nginx/tls/adcloud/fullchain.pem;
ssl_certificate_key /etc/nginx/tls/adcloud/privkey.pem;
ssl_protocols TLSv1.2 TLSv1.3;
client_max_body_size 1m;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
# This gateway is the public edge: overwrite untrusted forwarded headers.
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Connection "";
proxy_connect_timeout 5s;
proxy_read_timeout 30s;
proxy_send_timeout 30s;
# No URI suffix on proxy_pass: preserve /v1/... and query strings.
# Exact roots prevent nginx from redirecting POST /v1/events to a trailing slash.
location = /v1/events { proxy_pass http://adcloud_events; }
location = /v1/users { proxy_pass http://adcloud_users; }
location = /v1/ads { proxy_pass http://adcloud_ads; }
location = /v1/identity { proxy_pass http://adcloud_identity; }
location ^~ /v1/events/ { proxy_pass http://adcloud_events; }
location ^~ /v1/users/ { proxy_pass http://adcloud_users; }
location ^~ /v1/ads/ { proxy_pass http://adcloud_ads; }
location ^~ /v1/identity/ { proxy_pass http://adcloud_identity; }
# Future domains are handled by the versioned FastAPI router.
location /v1/ { proxy_pass http://adcloud_api; }
location = /health { proxy_pass http://adcloud_api; }
location / { return 404; }
}