Skip to content

Commit e83e182

Browse files
authored
OPSEXP-3015: set secure, sensible yet usable default for max upload files (#1049)
1 parent 7c0c175 commit e83e182

File tree

5 files changed

+18
-4
lines changed

5 files changed

+18
-4
lines changed

.envrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export AWS_REGION=eu-west-1
44
export MOLECULE_IT_AWS_VPC_SUBNET_ID=subnet-6bdd4223
55
export BRANCH_NAME=local
66
export BUILD_NUMBER=1
7-
export DTAS_VERSION=v1.6.0
7+
export DTAS_VERSION=v1.6.1
88
export MOLECULE_IT_ID=$(echo "$LOGNAME" | sha256sum | cut -c1-6)
99
ANSIBLE_VAULT_PASSWORD_FILE=$(expand_path ./.vault_pass.txt)
1010
export ANSIBLE_VAULT_PASSWORD_FILE

roles/adf_app/templates/default_server.conf.j2

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
server {
22
listen {{ adf_app_port }};
3-
client_max_body_size 0;
43

54
set $allowOriginSite *;
65
proxy_pass_request_headers on;

roles/nginx/defaults/main.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,9 @@ setup_vhosts: true
1111

1212
# Disable when nginx node is behind another reverse proxy (e.g. AWS ELB)
1313
nginx_set_proxy_headers: true
14+
1415
nginx_absolute_redirect: true
16+
17+
# Allow 5GB or 20 minutes long max uploads by default
18+
nginx_max_upload_size: "5g"
19+
nginx_max_upload_time: "20m"

roles/nginx/meta/argument_specs.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,11 @@ argument_specs:
1818
description: Useful when nginx node is behind another reverse proxy (e.g. should be disabled when behind an AWS ELB)
1919
type: bool
2020
default: true
21+
nginx_max_upload_size:
22+
description: The maximum allowed size of an upload (client request body)
23+
type: str
24+
default: 5g
25+
nginx_max_upload_time:
26+
description: Timeout of uploads (client requests read timeout)
27+
type: str
28+
default: 20m

roles/nginx/templates/alfresco_proxy.include.j2

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
client_max_body_size 0;
2-
31
absolute_redirect {{ 'on' if nginx_absolute_redirect else 'off' }};
42

53
set $allowOriginSite *;
@@ -30,11 +28,15 @@
3028
#ENV_ACCESS_LOG
3129

3230
location /share/ {
31+
client_max_body_size {{ nginx_max_upload_size }};
32+
client_body_timeout {{ nginx_max_upload_time }};
3333
proxy_pass http://share_lb;
3434
include {{ nginx_vhost_path }}/alfresco_proxy_headers.include;
3535
}
3636

3737
location /alfresco/ {
38+
client_max_body_size {{ nginx_max_upload_size }};
39+
client_body_timeout {{ nginx_max_upload_time }};
3840
proxy_pass http://repo_lb;
3941
include {{ nginx_vhost_path }}/alfresco_proxy_headers.include;
4042
}

0 commit comments

Comments
 (0)