Skip to content

Commit

Permalink
chore(revproxy): update nginx config to increase max request body siz…
Browse files Browse the repository at this point in the history
…e (manifestservice has no limit and we're running into issues with it being at 1m default) (#2052)

Co-authored-by: Alexander VT <[email protected]>
  • Loading branch information
Avantol13 and Avantol13-machine-user authored Dec 14, 2022
1 parent 4051ca1 commit cdccffc
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions kube/services/revproxy/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ types_hash_max_size 2048;
port_in_redirect off;
# server_tokens off;

# increase max from default 1m
client_max_body_size 200m;

# For websockets
map $http_upgrade $connection_upgrade {
default upgrade;
Expand Down Expand Up @@ -156,7 +159,7 @@ perl_set $namespace 'sub { return $ENV{"POD_NAMESPACE"}; }';
##
# For using fence, indexd, etc from a different namespace within the same k8 cluster -
# support data ecosystem feature ...
##
##
perl_set $des_domain 'sub { return $ENV{"DES_NAMESPACE"} ? qq{.$ENV{"DES_NAMESPACE"}.svc.cluster.local} : qq{.$ENV{"POD_NAMESPACE"}.svc.cluster.local}; }';

##
Expand Down Expand Up @@ -227,7 +230,7 @@ server {

# check request against ip black list
include /etc/nginx/manifest-revproxy/blacklist.conf;

#
# From https://enable-cors.org/server_nginx.html
# This overrides the individual services
Expand All @@ -245,7 +248,7 @@ server {

# update service release cookie
add_header Set-Cookie "service_releases=${service_releases};Path=/;Max-Age=600;HttpOnly;Secure;SameSite=Lax";

if ($request_method = 'OPTIONS') {
return 204;
}
Expand Down Expand Up @@ -297,8 +300,8 @@ server {
}

#
# initialize proxy_service and upstream used as key in logs to
# unspecified values -
# initialize proxy_service and upstream used as key in logs to
# unspecified values -
# individual service locations should override to "peregrine", ...
#
set $proxy_service "noproxy";
Expand Down Expand Up @@ -328,7 +331,7 @@ server {
proxy_busy_buffers_size 32k;
client_body_buffer_size 16k;
proxy_read_timeout 300;

#
# also incoming from client:
# * https://fullvalence.com/2016/07/05/cookie-size-in-nginx/
Expand Down Expand Up @@ -390,7 +393,7 @@ server {
return 500 "{ \"error\": \"service failure - try again later\"}";
}

location = /_status {
location = /_status {
default_type application/json;
set $upstream http://localhost;
return 200 "{ \"message\": \"Feelin good!\", \"csrf\": \"$csrf_token\" }\n";
Expand Down

0 comments on commit cdccffc

Please sign in to comment.