Cybersecurity-Projects/PROJECTS/advanced/ai-threat-detection/dev-log/nginx.conf

39 lines
1.0 KiB
Nginx Configuration File

# ©AngelaMos | 2026
# nginx.conf
#
# Nginx reverse proxy configuration for the dev-log traffic
# generation environment
#
# Listens on port 80, proxies all requests to the upstream
# FastAPI app on port 8000, and writes combined-format
# access logs to /var/log/nginx/access.log. Sets X-Real-IP,
# X-Forwarded-For, and X-Forwarded-Proto headers for the
# backend. The log output is mounted as a named volume in
# compose.yml for consumption by the ingestion pipeline
events {
worker_connections 64;
}
http {
access_log /var/log/nginx/access.log combined;
error_log /var/log/nginx/error.log warn;
upstream target_app {
server app:8000;
}
server {
listen 80;
server_name _;
location / {
proxy_pass http://target_app;
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;
}
}
}