   server {
    listen %%interface%%:%%port%% default_server;
    include /etc/nginx/includes/server_params.conf;
    include /etc/nginx/includes/proxy_params.conf;

    # https://emby.media/community/index.php?/topic/104238-playback-error-no-compatible-streams-are-currently-available/&do=findComment&comment=1097946
    proxy_buffering off;
    gzip_static off;
    client_max_body_size 0;

    location / {
      # Proxy pass
      proxy_pass http://localhost:9000;

      # Next three lines allow websockets
      proxy_http_version 1.1;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection "upgrade";

      # Improve ip handling
      proxy_hide_header X-Powered-By;
      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 Accept-Encoding "";
      proxy_read_timeout 90;
      add_header X-Frame-Options "SAMEORIGIN";
      add_header 'Referrer-Policy' 'no-referrer';

      # Correct base_url
      absolute_redirect off;
      proxy_redirect / %%ingress_entry%%/;
      sub_filter_once off;
      sub_filter_types *;
      sub_filter %%base_subpath%% %%ingress_entry%%/;
      sub_filter 'href="/"' 'href="%%ingress_entry%%/"';
      sub_filter '"\/"' '"%%ingress_entry%%\/"';
      }

}
