Skip to content

Commit 039157d

Browse files
Parameterization of the client_max_body_size directive in Nginx (#2014)
Enables users to customize client_max_body_size in Nginx conf to allow for larger file uploads. This is useful in cases when users need to upload large subscription manifest files. --------- Co-authored-by: Seth Foster <[email protected]>
1 parent bb4f4c2 commit 039157d

File tree

5 files changed

+11
-1
lines changed

5 files changed

+11
-1
lines changed

config/crd/bases/awx.ansible.com_awxs.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -1736,6 +1736,9 @@ spec:
17361736
nginx_worker_connections:
17371737
description: Set the number of connections per worker for nginx
17381738
type: integer
1739+
nginx_client_max_body_size:
1740+
description: Sets the maximum allowed size of the client request body in megabytes (defaults to 5M)
1741+
type: integer
17391742
nginx_worker_cpu_affinity:
17401743
description: Set the CPU affinity for nginx workers
17411744
type: string

config/manifests/bases/awx-operator.clusterserviceversion.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -584,6 +584,11 @@ spec:
584584
- urn:alm:descriptor:com.tectonic.ui:advanced
585585
- urn:alm:descriptor:com.tectonic.ui:number
586586
- urn:alm:descriptor:com.tectonic.ui:hidden
587+
- displayName: Set the maximum allowed size of the client request body in megabytes for nginx
588+
path: nginx_client_max_body_size
589+
x-descriptors:
590+
- urn:alm:descriptor:com.tectonic.ui:advanced
591+
- urn:alm:descriptor:com.tectonic.ui:number
587592
- displayName: Task Replicas
588593
path: task_replicas
589594
x-descriptors:

docs/user-guide/advanced-configuration/custom-volume-and-volume-mount-options.md

+1
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ configuration.
115115
* [worker_cpu_affinity](http://nginx.org/en/docs/ngx_core_module.html#worker_cpu_affinity) with `nginx_worker_cpu_affinity` (default "auto")
116116
* [worker_connections](http://nginx.org/en/docs/ngx_core_module.html#worker_connections) with `nginx_worker_connections` (minimum of 1024)
117117
* [listen](https://nginx.org/en/docs/http/ngx_http_core_module.html#listen) with `nginx_listen_queue_size` (default same as uwsgi listen queue size)
118+
* [client_max_body_size](https://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size) with `nginx_client_max_body_size` (default of 5M)
118119

119120
## Custom Logos
120121

roles/installer/defaults/main.yml

+1
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,7 @@ nginx_worker_processes: 1
503503
nginx_worker_connections: "{{ uwsgi_listen_queue_size }}"
504504
nginx_worker_cpu_affinity: 'auto'
505505
nginx_listen_queue_size: "{{ uwsgi_listen_queue_size }}"
506+
nginx_client_max_body_size: 5
506507

507508
extra_settings_files: {}
508509

roles/installer/templates/configmaps/config.yaml.j2

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ data:
109109
include /etc/nginx/mime.types;
110110
default_type application/octet-stream;
111111
server_tokens off;
112-
client_max_body_size 5M;
112+
client_max_body_size {{ nginx_client_max_body_size }}M;
113113

114114
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
115115
'$status $body_bytes_sent "$http_referer" '

0 commit comments

Comments
 (0)