Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: increase proxy buffer size/number for auth #14

Merged
merged 3 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions conf/nginx.conf.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ http {
location / {
# Reverse proxy settings
include /gateway/conf/proxy.conf;
include /gateway/conf/proxy_large_headers.conf;

# Immediate set/re-use means we don't get resolve errors if not up (as opposed to passing as a literal)
set $upstream_auth http://${BENTOV2_AUTH_CONTAINER_NAME}:${BENTOV2_AUTH_INTERNAL_PORT_PLAIN_HTTP};
Expand Down
4 changes: 4 additions & 0 deletions conf/proxy.conf
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,8 @@ proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

# increase size of response buffers for returning larger responses
# (small-medium files, large JSON responses, etc.)
proxy_buffers 64 4k;

proxy_ignore_client_abort on;
5 changes: 5 additions & 0 deletions conf/proxy_large_headers.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# inspired by https://www.getpagespeed.com/server-setup/nginx/tuning-proxy_buffer_size-in-nginx
# proxy_buffers is set in proxy.conf

proxy_buffer_size 16k;
proxy_busy_buffers_size 24k;