bunkerweb icon indicating copy to clipboard operation
bunkerweb copied to clipboard

[FEATURE] allow to modify nginx default buffer setting to handle "upstream sent too big header"

Open chrismade opened this issue 1 year ago • 1 comments

What's needed and why?

I came across this issue earlier in the combination bunkerweb+keycloak - and see it now again in the combination bunkerweb+mailcow - nginx has some default buffer setting which are exceeded in some cases (like the ones mentioned - and there are likely a few more which just has not discovered yet) - bunker has a setting already for REVERSE_PROXY_BUFFERING=yes but it might also be required to change the count and sizes of the buffers - for which I have not yet found anything in UI to change the setting or anywhere else in the documentation.

in bunkerweb < 1.5.0 I changed settings by adding a file in configs/http/proxybuffers.com like this

proxy_buffer_size   128k;
proxy_buffers   4 256k;

but I'm not sure if this is still the intended way to make changes in bunkerweb > 1.5.0 or if it even cause more harm than good to make changes directly in nginx configs - hence I would prefer either an "official" documented procedure for these changes or ideally option to make such changes in the config UI or variables.

Implementations ideas (optional)

I assume not much code needs to be developed from scratch - UI settings and variables already exist for REVERSE_PROXY_BUFFERING=yes/no and we just need to more variables (and their respective UI components + regex for checking) to allow users to modify the default buffers if they run across the "upstream sent too big header" in their specific application(s)

here I found more background why this is needed: https://github.com/mailcow/mailcow-dockerized/issues/4537 and here (with hints for k8s implementation): https://stackoverflow.com/questions/57503590/upstream-sent-too-big-header-while-reading-response-header-from-upstream-in-keyc

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

chrismade avatar Jan 31 '24 08:01 chrismade

Hi @chrismade, custom configurations are still available in BunkerWeb 1.5.X https://docs.bunkerweb.io/latest/quickstart-guide/#custom-configurations

TheophileDiot avatar Feb 05 '24 11:02 TheophileDiot