Skip to content

Commit

Permalink
Merge pull request #14 from bento-platform/fix/large-keycloak-headers
Browse files Browse the repository at this point in the history
fix: increase proxy buffer size/number for auth
  • Loading branch information
davidlougheed authored Apr 23, 2024
2 parents cf35cca + 3a00470 commit 31be7eb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
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;

0 comments on commit 31be7eb

Please sign in to comment.