server {
    listen 80;
    root /usr/share/nginx/html;
    index index.html;

    # Proxy API calls to Django
    location /api/ {
        proxy_pass http://app:8000;
        proxy_set_header Host web;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        client_max_body_size 10M;
    }

    # Proxy media files to Django
    location /media/ {
        proxy_pass http://app:8000;
        proxy_set_header Host web;
    }

    # Static files
    location / {
        try_files $uri $uri/ $uri.html =404;
    }
}
