From 0136c6c9db049873d6732fe46576b055283272f9 Mon Sep 17 00:00:00 2001 From: Benoit Crickboom Date: Wed, 7 Aug 2024 12:28:36 +0200 Subject: [PATCH] added PROXY_READ_TIMEOUT env var for nginx --- sources/README-dockerhub-orthanc-nginx.md | 7 ++++++- sources/nginx/copy-conf-files.sh | 4 ++++ sources/nginx/nginx-common.conf | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/sources/README-dockerhub-orthanc-nginx.md b/sources/README-dockerhub-orthanc-nginx.md index 83c5657..1ad18d9 100644 --- a/sources/README-dockerhub-orthanc-nginx.md +++ b/sources/README-dockerhub-orthanc-nginx.md @@ -17,7 +17,12 @@ Web service to run in front of Orthanc to handle sharing of studies & admin inte | ENABLE_ORTHANC_FOR_API | false | Access to Orthanc for api (e.g. for DicomWeb clients or scripts) | `/orthanc-api/` | `http://orthanc-for-api:8042` | | ENABLE_ORTHANC_FOR_SHARES | false | Access to Orthanc for shares (publication links). This is required only if you are not using keycloak and are enabling shares. | `/shares/` | `http://orthanc-for-shares:8042` | | ENABLE_OHIF | false | Access to OHIF viewer | `/ohif/` | `http://ohif:80` | -| ENABLE_HTTPS | false | Enables HTTPS | NA | NA | + + +| Environment variable | Default value | Description | +|----------------------------|:-------------------------|:----------------------------------------------------------------------------------------------------------------| +| ENABLE_HTTPS | false | Enables HTTPS | +| PROXY_READ_TIMEOUT | 60 | Nginx `proxy_read_timeout` variable (s) | If `ENABLE_HTTPS` is set to `true`, you must also provide a certificate file in `/etc/nginx/tls/crt.pem` and a private key in `/etc/nginx/tls/key.pem`. diff --git a/sources/nginx/copy-conf-files.sh b/sources/nginx/copy-conf-files.sh index 8e864d3..c0e2504 100755 --- a/sources/nginx/copy-conf-files.sh +++ b/sources/nginx/copy-conf-files.sh @@ -27,6 +27,10 @@ enableOrthancTokenService="${ENABLE_ORTHANC_TOKEN_SERVICE:-false}" enableOhif="${ENABLE_OHIF:-false}" enableMedDream="${ENABLE_MEDDREAM:-false}" +# manage proxy_read_timeout value +proxy_read_timeout="${PROXY_READ_TIMEOUT:-60}" +sed -i "s/proxy_read_timeout_placeholder/${proxy_read_timeout}s/g" /etc/nginx/includes/nginx-common.conf + ls -al /etc/nginx/disabled-reverse-proxies/ if [[ $enableOrthanc == "true" ]]; then diff --git a/sources/nginx/nginx-common.conf b/sources/nginx/nginx-common.conf index 7627a3b..55187cb 100644 --- a/sources/nginx/nginx-common.conf +++ b/sources/nginx/nginx-common.conf @@ -3,7 +3,7 @@ # SPDX-License-Identifier: CC0-1.0 # To avoid 504 error when uploading big files -proxy_read_timeout 600s; +proxy_read_timeout proxy_read_timeout_placeholder; # To avoid "too big header... / 502 Bad Gateway" error (inspired from https://www.getpagespeed.com/server-setup/nginx/tuning-proxy_buffer_size-in-nginx) proxy_buffer_size 32k;