The connection to https://drone/api/stream was interrupted while the page was loading

This issue came up a couple years ago but no answer was provided. If the drone community can provide any insight into this it would be extremely helpful. SSE aren’t that common even today and Drones usage of it make it an outlier.

I’ve spent about two days trying every suggestion on handling SSE with the nginx reverse proxy but I still keep getting disconnected.

My setup isn’t that uncommon, Drone running in a docker container with HTTP exposed on, nginx is providing HTTPS. I’ve ended up using just about every header suggested (and combination thereof) with no luck.

upstream drone {
        server localhost:3001;

        keepalive 1000000;

  location /api/stream {

        proxy_pass http://drone;

        chunked_transfer_encoding off;
        proxy_buffering off;
        proxy_cache off;
        proxy_http_version 1.1;
        proxy_redirect off;
        proxy_set_header Connection '';
        proxy_set_header Content-Type text/event-stream;
        proxy_set_header Cache-Control no-cache;
        proxy_set_header Host $host;
        #proxy_set_header Origin "";
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header X-Accel-Buffering no;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $remote_addr;