server {
    listen 9000;
    server_name localhost;

    # Allow large uploads
    client_max_body_size 64m;

    location / {
        proxy_pass http://seaweedfs:8333;

        # Standard reverse proxy headers — this is what Kong, Traefik, etc. do
        proxy_set_header Host              $host:$server_port;
        proxy_set_header X-Real-IP         $remote_addr;
        proxy_set_header X-Forwarded-For   $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Host  $host;
        proxy_set_header X-Forwarded-Port  $server_port;
        proxy_set_header X-Forwarded-Proto $scheme;

        proxy_http_version 1.1;
        proxy_buffering off;
        proxy_request_buffering off;
    }
}
