gotson / komga

Media server for comics/mangas/BDs/magazines/eBooks with API, OPDS and Kobo Sync support
https://komga.org
MIT License
3.85k stars 232 forks source link

Introduce new env variable for X-Accel-Buffering #1465

Closed DeJoon closed 4 months ago

DeJoon commented 5 months ago

Describe your suggested feature

It would be nice to introduce a new environment variable to set X-Accel-Buffering no; to the Komga responses, for people using their instance behind a proxy like Cloudflare.

Other details

When using a Komga instance behind Cloudflare as a proxy and Nginx as reverse proxy, where Cloudflare is essentially passing the request to Nginx, the refreshing of the view doesn't work anymore, because of proxy buffering: https://serverfault.com/questions/801628/for-server-sent-events-sse-what-nginx-proxy-configuration-is-appropriate

This can be fixed in two ways, either by adding proxy_buffering off; which comes with some disadvantages: https://www.nginx.com/blog/avoiding-top-10-nginx-configuration-mistakes/#proxy_buffering-off

The alternative solution would be to add X-Accel-Buffering: no; to the Komga responses.

Discord: https://discord.com/channels/678794935368941569/678795177393127424/1227207179774464020

Huge thank you to @Snd-R for supporting me in this case and figuring out, what the problem is, as well as providing me with the solution.

Acknowledgements

gotson commented 4 months ago

The alternative solution would be to add X-Accel-Buffering: no; to the Komga responses.

just add that in Nginx ?

gotson commented 4 months ago

It seems this is a Nginx custom header, not standard. I won't be adding this.