Skip to content

Commit

Permalink
Set Apache LimitRequestBody with env variable APACHE_BODY_LIMIT (#2065)
Browse files Browse the repository at this point in the history
* feat: set apache LimitRequestBody

Signed-off-by: adripo <[email protected]>

* feat: APACHE_BODY_LIMIT variable

Signed-off-by: adripo <[email protected]>

* fix: move ENV to existing VARIANT_EXTRAS

Signed-off-by: adripo <[email protected]>

* docs: updated var description

Signed-off-by: adripo <[email protected]>

* fix: remove comment

Signed-off-by: adripo <[email protected]>

---------

Signed-off-by: adripo <[email protected]>
  • Loading branch information
adripo authored Sep 16, 2023
1 parent 4cd7038 commit 90064ed
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,10 @@ To customize other PHP limits you can simply change the following variables:
- `PHP_MEMORY_LIMIT` (default `512M`) This sets the maximum amount of memory in bytes that a script is allowed to allocate. This is meant to help prevent poorly written scripts from eating up all available memory but it can prevent normal operation if set too tight.
- `PHP_UPLOAD_LIMIT` (default `512M`) This sets the upload limit (`post_max_size` and `upload_max_filesize`) for big files. Note that you may have to change other limits depending on your client, webserver or operating system. Check the [Nextcloud documentation](https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/big_file_upload_configuration.html) for more information.

To customize Apache max file upload limit you can change the following variable:
- `APACHE_BODY_LIMIT` (default `1073741824` [1GiB]) This restricts the total
size of the HTTP request body sent from the client. It specifies the number of _bytes_ that are allowed in a request body. A value of **0** means **unlimited**. Check the [Nextcloud documentation](https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/big_file_upload_configuration.html#apache) for more information.


## Auto configuration via hook folders

Expand Down
2 changes: 1 addition & 1 deletion update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ declare -A base=(
)

declare -A extras=(
[apache]='\nRUN a2enmod headers rewrite remoteip ;\\\n {\\\n echo RemoteIPHeader X-Real-IP ;\\\n echo RemoteIPInternalProxy 10.0.0.0/8 ;\\\n echo RemoteIPInternalProxy 172.16.0.0/12 ;\\\n echo RemoteIPInternalProxy 192.168.0.0/16 ;\\\n } > /etc/apache2/conf-available/remoteip.conf;\\\n a2enconf remoteip'
[apache]='\nRUN a2enmod headers rewrite remoteip ; \\\n { \\\n echo '\''RemoteIPHeader X-Real-IP'\''; \\\n echo '\''RemoteIPInternalProxy 10.0.0.0/8'\''; \\\n echo '\''RemoteIPInternalProxy 172.16.0.0/12'\''; \\\n echo '\''RemoteIPInternalProxy 192.168.0.0/16'\''; \\\n } > /etc/apache2/conf-available/remoteip.conf; \\\n a2enconf remoteip\n\n# set apache config LimitRequestBody\nENV APACHE_BODY_LIMIT 1073741824\nRUN { \\\n echo '\''LimitRequestBody ${APACHE_BODY_LIMIT}'\''; \\\n } > /etc/apache2/conf-available/apache-limits.conf; \\\n a2enconf apache-limits'
[fpm]=''
[fpm-alpine]=''
)
Expand Down

0 comments on commit 90064ed

Please sign in to comment.