Skip to content

Commit 455a3d3

Browse files
authored
Merge pull request #57 from Dstack-TEE/body-size
ingress: Support for setting max client body size
2 parents 68511eb + 401dd24 commit 455a3d3

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

custom-domain/dstack-ingress/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ configs:
176176
- `CERTBOT_EMAIL`: Your email address used in Let's Encrypt certificate requests
177177
- `TARGET_ENDPOINT`: The plain HTTP endpoint of your dstack application (for single domain mode)
178178
- `SET_CAA`: Set to `true` to enable CAA record setup
179+
- `CLIENT_MAX_BODY_SIZE`: Optional value for nginx `client_max_body_size` (e.g. `50m`) in single-domain mode
179180

180181
**Backward Compatibility:**
181182

custom-domain/dstack-ingress/scripts/entrypoint.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ setup_certbot_env() {
4949
setup_py_env
5050

5151
setup_nginx_conf() {
52+
local client_max_body_size_conf=""
53+
if [ -n "$CLIENT_MAX_BODY_SIZE" ]; then
54+
client_max_body_size_conf=" client_max_body_size ${CLIENT_MAX_BODY_SIZE};"
55+
fi
56+
5257
cat <<EOF >/etc/nginx/conf.d/default.conf
5358
server {
5459
listen ${PORT} ssl;
@@ -88,6 +93,7 @@ server {
8893
8994
# Disable SSL renegotiation
9095
ssl_early_data off;
96+
${client_max_body_size_conf}
9197
9298
location / {
9399
${PROXY_CMD}_pass ${TARGET_ENDPOINT};

0 commit comments

Comments
 (0)