Skip to content

Commit

Permalink
configurable client_max_body_size
Browse files Browse the repository at this point in the history
in /server/ location
  • Loading branch information
kosarko committed Jan 16, 2024
1 parent 26a6b6c commit b3a7090
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ NGINX_SHIBAUTHORIZER=
NGINX_SHIBRESPONDER=
```

The dspace backend location has a configurable `client_max_body_size` via
```
NGINX_MAX_BODY_SIZE
```

Nginx by default logs to stdout/stderr and syslog (provided by fluent-bit image). The syslog entries are written into the `logs` volume.

## additional configs for shibboleth
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ services:
- NGINX_NODE
- NGINX_SERVER_NAMES
- NGINX_RESOLVERS
# this configures client_max_body_size only for the repository /server location
- NGINX_MAX_BODY_SIZE=${NGINX_MAX_BODY_SIZE:-10G}
depends_on:
- shibboleth

Expand Down
14 changes: 14 additions & 0 deletions nginx/conf/templates/default.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,19 @@ upstream node {
server ${NGINX_NODE};
}

# set client body size to 512M #
client_max_body_size 512M;

# Sets buffer size for reading client request body. In case the request body is larger than the buffer,
# the whole body or only its part is written to a temporary file. By default, buffer size is equal to two memory pages.
client_body_buffer_size 256k;

# Defines a timeout for reading client request body. The timeout is set only for a period between two successive read
# operations, not for the transmission of the whole request body.
client_body_timeout 5s;
# Defines a timeout for reading client request header.
client_header_timeout 5s;

server {
error_log /var/log/nginx/error.log notice;
access_log /var/log/nginx/access.log main;
Expand Down Expand Up @@ -60,6 +73,7 @@ server {

location /server/ {
include proxy_params;
client_max_body_size ${NGINX_MAX_BODY_SIZE};
proxy_pass http://tomcat;
}

Expand Down

0 comments on commit b3a7090

Please sign in to comment.