server {
    listen 80;
    server_name _;

    # Max upload size
    client_max_body_size 75M;

    # Serve static files
    location /static/ {
        alias /app/static/;
        expires 30d;
        add_header Cache-Control "public, max-age=2592000";
    }

    # Serve media files
    location /media/ {
        alias /app/media/;
        expires 30d;
        add_header Cache-Control "public, max-age=2592000";
    }

    # Proxy pass all other requests to Gunicorn (or uWSGI)
    location / {
        proxy_pass http://web:8001/;  # Gunicorn/WSGI server address
        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;
    }
}