summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@baturin.org>2024-03-07 20:04:56 +0000
committerMergify <37929162+mergify[bot]@users.noreply.github.com>2024-03-07 21:03:56 +0000
commit00352f4edadfa536b35112c1d2d2cdf72ffb4cd6 (patch)
tree54646d0be93bfe0d5667902b99979424972c06ba
parentfcd2fc01101960c5e8d4fd04995417d35233b16a (diff)
downloadvyos-1x-00352f4edadfa536b35112c1d2d2cdf72ffb4cd6.tar.gz
vyos-1x-00352f4edadfa536b35112c1d2d2cdf72ffb4cd6.zip
http-api: T6107: add an option to increase the request body size limit
(cherry picked from commit 4792d39bb84991768404f69ff807e43a9979a79e)
-rw-r--r--data/templates/https/nginx.default.j24
-rw-r--r--interface-definitions/service_https.xml.in13
2 files changed, 17 insertions, 0 deletions
diff --git a/data/templates/https/nginx.default.j2 b/data/templates/https/nginx.default.j2
index 5d17df001..4619361e5 100644
--- a/data/templates/https/nginx.default.j2
+++ b/data/templates/https/nginx.default.j2
@@ -21,6 +21,10 @@ server {
server_name {{ hostname }};
root /srv/localui;
+{% if request_body_size_limit is vyos_defined %}
+ client_max_body_size {{ request_body_size_limit }}M;
+{% endif %}
+
# SSL configuration
{% if certificates.cert_path is vyos_defined and certificates.key_path is vyos_defined %}
ssl_certificate {{ certificates.cert_path }};
diff --git a/interface-definitions/service_https.xml.in b/interface-definitions/service_https.xml.in
index b60c7ff2e..afe430c0c 100644
--- a/interface-definitions/service_https.xml.in
+++ b/interface-definitions/service_https.xml.in
@@ -138,6 +138,19 @@
<leafNode name='port'>
<defaultValue>443</defaultValue>
</leafNode>
+ <leafNode name="request-body-size-limit">
+ <properties>
+ <help>Maximum request body size in megabytes</help>
+ <valueHelp>
+ <format>u32:1-256</format>
+ <description>Request body size in megabytes</description>
+ </valueHelp>
+ <constraint>
+ <validator name="numeric" argument="--range 1-256"/>
+ </constraint>
+ </properties>
+ <defaultValue>1</defaultValue>
+ </leafNode>
<node name="certificates">
<properties>
<help>TLS certificates</help>