Streaming Error - Subscription error: Unknown stream type

EDIT: Found solution (I accidentally removed some necessary parts of the nginx.conf file).

I am able to connect properly to my mastodon-web container, but I get an error when connecting to the streaming api. I am able to talk to the streaming container, but it throws Subscription error: Unknown stream type. What could cause this?

I am using a docker setup based around this tutorial. I have integrated it within a jwilder/nginx-proxy setup by added a intermediate nginx container to place the custom configurations found in the tutorial. So the final setup is client -> nginx-proxy -> nginx -> mastodon-web & mastodon-streaming.

The full logs of the streaming container are below:

info Starting streaming API server master with 7 workers 
info Starting worker 7 
info Starting worker 4 
info Worker 7 now listening on 0.0.0.0:4000 
info Starting worker 3 
info Starting worker 6 
info Starting worker 1 
info Starting worker 5 
info Worker 4 now listening on 0.0.0.0:4000 
info Starting worker 2 
info Worker 3 now listening on 0.0.0.0:4000 
info Worker 1 now listening on 0.0.0.0:4000 
info Worker 5 now listening on 0.0.0.0:4000 
info Worker 6 now listening on 0.0.0.0:4000 
info Worker 2 now listening on 0.0.0.0:4000 
verb Subscribe timeline:access_token:4 
verb a37d48cb-4441-4b61-9848-7e1c0cda9850 Subscription error: Unknown stream type
verb Unsubscribe timeline:access_token:4 
verb Subscribe timeline:access_token:4 
verb c5e70e14-75e5-47dd-983a-53ded5d97774 Subscription error: Unknown stream type
verb Unsubscribe timeline:access_token:4 
verb Subscribe timeline:access_token:4 
verb eecae3c9-33dd-4d05-86ea-2516c8569040 Subscription error: Unknown stream type
verb Unsubscribe timeline:access_token:4 
verb Subscribe timeline:access_token:4 
verb 822d5448-4af0-4e63-bfab-ae55706c4cb6 Subscription error: Unknown stream type
verb Unsubscribe timeline:access_token:4 
verb Subscribe timeline:access_token:4 
verb 5596de18-22a2-4e2c-86e7-bd6a8881d17c Subscription error: Unknown stream type
verb Unsubscribe timeline:access_token:4

Below is the correct config for the setup I described. In this setup, the web container’s host-name is called mast-web and the streaming container’s host-name is mast-streaming. I also passed in the persistent public folder to the nginx container at /home/mastodon/live/public.

This is just the INTERNAL config and therefore DOES NOT use HTTPS.

map $http_upgrade $connection_upgrade {
  default upgrade;
  ''      close;
}

upstream backend {
    server mast-web:3000 fail_timeout=0;
}

upstream streaming {
    server mast-streaming:4000 fail_timeout=0;
}

proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=CACHE:10m inactive=7d max_size=1g;

server {
  listen 80;
  listen [::]:80;
  server_name mast.godfreyhendrix.com;
  root /home/mastodon/live/public;

  keepalive_timeout    70;
  sendfile             on;
  client_max_body_size 80m;

  gzip on;
  gzip_disable "msie6";
  gzip_vary on;
  gzip_proxied any;
  gzip_comp_level 6;
  gzip_buffers 16 8k;
  gzip_http_version 1.1;
  gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

  location / {
    try_files $uri @proxy;
  }

  location ~ ^/(emoji|packs|system/accounts/avatars|system/media_attachments/files) {
    add_header Cache-Control "public, max-age=31536000, immutable";
    try_files $uri @proxy;
  }

  location /sw.js {
    add_header Cache-Control "public, max-age=0";
    try_files $uri @proxy;
  }

  location @proxy {
    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;
    proxy_set_header Proxy "";
    proxy_pass_header Server;

    proxy_pass http://backend;
    proxy_buffering on;
    proxy_redirect off;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection $connection_upgrade;

    proxy_cache CACHE;
    proxy_cache_valid 200 7d;
    proxy_cache_valid 410 24h;
    proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504;
    add_header X-Cached $upstream_cache_status;

    tcp_nodelay on;
  }

  location /api/v1/streaming {
    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;
    proxy_set_header Proxy "";

    proxy_pass http://streaming;
    proxy_buffering off;
    proxy_redirect off;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection $connection_upgrade;

    tcp_nodelay on;
  }

  error_page 500 501 502 503 504 /500.html;
  
}

EDIT: Just fixed the formatting of the config for better viewing.

For the record, the solution was: