Skip to content

Commit 06d8428

Browse files
committed
Make client_max_body_size configuable
1 parent fd44517 commit 06d8428

File tree

4 files changed

+5
-0
lines changed

4 files changed

+5
-0
lines changed

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ RUN rm -f /etc/nginx/conf.d/*
77

88
ENV SERVER_NAME example.com
99
ENV PORT 80
10+
ENV CLIENT_MAX_BODY_SIZE 1m
1011
ENV WORKER_PROCESSES auto
1112

1213
COPY files/run.sh /

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ $ docker-compose up
5353
|---|---|---|
5454
|`SERVER_NAME`|Value for `server_name` directive|`example.com`|
5555
|`PORT`|Value for `listen` directive|`80`|
56+
|`CLIENT_MAX_BODY_SIZE`|Value for `client_max_body_size` directive|`1m`|
5657
|`WORKER_PROCESSES`|Value for `worker_processes` directive|`auto`|
5758

5859
## Author

files/nginx.conf.tmpl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ http {
1515
listen ##PORT##;
1616
server_name ##SERVER_NAME##;
1717

18+
client_max_body_size ##CLIENT_MAX_BODY_SIZE##;
19+
1820
include /etc/nginx/conf.d/*.conf;
1921

2022
location / {

files/run.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ fi
1919

2020
htpasswd -bBc /etc/nginx/.htpasswd $BASIC_AUTH_USERNAME $BASIC_AUTH_PASSWORD
2121
sed \
22+
-e "s/##CLIENT_MAX_BODY_SIZE##/$CLIENT_MAX_BODY_SIZE/g" \
2223
-e "s/##WORKER_PROCESSES##/$WORKER_PROCESSES/g" \
2324
-e "s/##SERVER_NAME##/$SERVER_NAME/g" \
2425
-e "s/##PORT##/$PORT/g" \

0 commit comments

Comments
 (0)